API for getting resource Handle
-
Hi all, Can anybody tell me is there any other api for finding resource handle except AfxGetResourceHandle() in vc2005 thanks in advance...
-
Hi all, Can anybody tell me is there any other api for finding resource handle except AfxGetResourceHandle() in vc2005 thanks in advance...
AfxFindResourceHandle()
-
Hi all, Can anybody tell me is there any other api for finding resource handle except AfxGetResourceHandle() in vc2005 thanks in advance...
Hello there, I believe that AfxGetResourceHandle() is simply returning the allocation base of the module which contains the resource your attempting to access. This is so it can correctly calculate PE image offsets. Therefore you should be able to simply do the following: If the resource is located inside the module your executing code from you can do this:
#define MyGetResourceHandle ((HINSTANCE)&__ImageBase) HICON hIco1 = (HICON) LoadImage(MyGetResourceHandle,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,16,16,0);
Best Wishes, -David Delaune