Click to See Complete Forum and Search --> : CByteArray - way to quick load?


April 30th, 1999, 07:56 AM
I'm running into major delays copying blocks of binary data into CByteArray manually. Wouldn't it seem logical to provide a way to fastload a cba, to wit:

CByteArray cba;
cba.SetSize(8192);
memcpy(cba.GetBuffer(0), (LPBYTE) p, cba.GetSize());

Does some facility like this exist? Or am I just missing the incredibly obvious...

Thx, Dave Minor
mailto:davem@comports.com

April 30th, 1999, 08:22 AM
Can't you just alter your memcpy to point to the first element?

memcpy(&cba.ElementAt(0),(LPBYTE) p, cba.GetSize());