D
dotnetchic
(Sorry about cross-post to MFC...got no reply so I'm reposting here)
Porting my code over from VC++6 to MC++, loading bitmaps from resources
broke. This code is in a lib file (previously, it was a dll)...don't
know how that affects it. Here's what we had previously that worked:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
HINSTANCE hInst = GetModuleHandle("ThisLibrary.dll");
HBITMAP hBitmap = ::LoadBitmap(hInst, MAKEINTRESOURCE(ID));
(1) I tried to load the dll as above, which didn't work. (2) I tried
getting the module handle from ThisLibrary.lib (which is how it is
currently compiled), which did not work. (3) I tried compiling as
native and repeating 1 & 2 above, which did not work. (4) Also tried
load image which didn't work:
HBITMAP hBitmap = (HBITMAP)LoadImage(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDB_LOOPC01),
IMAGE_BITMAP,
0, 0, 0);
Can someone tell me how to resolve this? Is there a better way to load
resources at runtime?
TIA,
Sharon
Porting my code over from VC++6 to MC++, loading bitmaps from resources
broke. This code is in a lib file (previously, it was a dll)...don't
know how that affects it. Here's what we had previously that worked:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
HINSTANCE hInst = GetModuleHandle("ThisLibrary.dll");
HBITMAP hBitmap = ::LoadBitmap(hInst, MAKEINTRESOURCE(ID));
(1) I tried to load the dll as above, which didn't work. (2) I tried
getting the module handle from ThisLibrary.lib (which is how it is
currently compiled), which did not work. (3) I tried compiling as
native and repeating 1 & 2 above, which did not work. (4) Also tried
load image which didn't work:
HBITMAP hBitmap = (HBITMAP)LoadImage(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDB_LOOPC01),
IMAGE_BITMAP,
0, 0, 0);
Can someone tell me how to resolve this? Is there a better way to load
resources at runtime?
TIA,
Sharon