problem with MEMCPY from DIB to buffer | developer.brewmp.com problem with MEMCPY from DIB to buffer | developer.brewmp.com

Developer

problem with MEMCPY from DIB to buffer

Forums:

I have one Device dependent bitmap DDBmp, which is created using the function
IBITMAP_CreateCompatibleBitmap()

now i am drawing some text into that bitmap using the bellow func
IFONT_DrawText(pFont, DDBmp, x, y, text, textLen, fgColor , 0, &clipRect, IDF_TEXT_TRANSPARENT)
Font instance is already created.

to get the device independent bitmap i used
IBITMAP_QueryInterface(DDBmp, AEECLSID_DIB, (void**)&psrcDib)
where psrcDib ---- IDIB * type

now i want to memcopy from psrcDib->pBmp to a buffer of unsigned short * type(wide type).Here the buffer is nothing but screen.
i.e MEMCPY(destBuffer, psrcDib->pBmp,n)
where n is (psrcDib->nPitch * height * bytesPerPixel)

the required text is not getting displayed on the screen.

I tried with IBITMAP_BltIn() instead of memcpy...it doesn't work...becoz of destBuff
to which i can't typecast with ibitmap *

pls tell me any method to do copy from IDIB->pBmp to destBuff of type unsigned short * type.