Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - LoadBitmapFromResource on x64
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

LoadBitmapFromResource on x64

 Post Reply Post Reply
Author
Message
bob.fortin View Drop Down
Newbie
Newbie


Joined: 27 February 2013
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote bob.fortin Quote  Post ReplyReply Direct Link To This Post Topic: LoadBitmapFromResource on x64
    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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.187 seconds.