LoadBitmapFromResource on x64 |
Post Reply |
Author | |
bob.fortin
Newbie Joined: 27 February 2013 Status: Offline Points: 1 |
Post Options
Thanks(0)
Posted: 27 February 2013 at 4:22pm |
I am porting some code to run under a 64 bit windows exe.
IImageManagerIconsPtr pActiveIcons = GetActiveIconsPtr(); if (pActiveIcons) { HRESULT hr = pActiveIcons->LoadBitmapFromResource((long)lResourceInst, lSmallResId, CComVariant((LPSAFEARRAY)safeCommands), xtpImageNormal); ATLASSERT(SUCCEEDED(hr)); This works on 32bit codejock, but not on x64. I have an hintance of a resource, which is a long on win32, but a 64bit value on x64. I am confused why the LoadBitmapFromResource method only takes a long as a parameter - forcing me to cast the 64bit pointer to 32bits, and making it not valid so that the call does not work. The lResourceInst is 0x0000000180000000 which gets casted to 0x0000000080000000. The when I call LoadBitmapFromResource it returns success but the bitmap does not draw later and this shows in the debug window: First-chance exception at 0x000007fb9808fbf7 in mapinfow.exe: 0xC0000005: Access violation reading location 0x0000000080000000. Is there a way to call the com method with a 64bit instance handle? I am using wrappers generated by visual studio compilation. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |