
Bitmaps don't load on some machines
Hi
I am using the following code for drawing a bitmap in an ownerdraw list
box. I use Visual C 5.0.
The bitmap is displayed when running on some pc's but not when running
on others (no error message appears).
The only difference is that Visual C development environment is not
installed on the PC where the bitmaps aren't displayed
Am I missing some DLL files?
.
.
.
CBitmap bitmap;
BITMAP bmp;
CPictureHolder picHolder;
CRect rcSrcBounds;
char szResourceName[32],szStr[64],szStr2[64];
sprintf(szResourceName,"IDBN_%s",Currencies[lpDIS->itemData].Code);
if(bitmap.LoadBitmap(szResourceName))
{
if(bitmap.GetObject(sizeof(BITMAP), &bmp))
{
rcSrcBounds.right = bmp.bmWidth;
rcSrcBounds.bottom = bmp.bmHeight;
rcSrcBounds.left=rcSrcBounds.top=0;
CRect dest(3,
lpDIS->rcItem.top+2,
bmp.bmWidth+3,
lpDIS->rcItem.bottom-(ITEM_HEIGHT-bmp.bmHeight)/2);
if(picHolder.CreateFromBitmap((HBITMAP)bitmap.m_hObject, NULL,
FALSE))
picHolder.Render(pDC,dest, rcSrcBounds);
}
bitmap.DeleteObject();
}
Thanx,
Tomer