Has anyone tried using the CreateSurface(BYTE *buffer, DWORD size) method to load a bitmap from a bitmap image file in memory ?? When I try, the call crashes without yielding an error code.
for example:
CGapiSurface *s = new CGapiSurface();
s->CreateSurface(buffer, size);
where buffer is a BYTE[] of length 'size' that was pre-filled with a .bmp file that was loaded into buffer[]. I simply used CFile::Read() to load a 'test.bmp' into memory.
Am I doing something wrong or does this method require a different image of a .bmp ?
If I put the same .bmp file in the resource fork and use the other CreateSurface() call and it works fine.
Any help is greatly appreciated.
Thanks.
Jeff