![]() |
LoadBitmapFromResource finds wrong resource |
Post Reply ![]() |
Author | |
rdhd ![]() Senior Member ![]() ![]() Joined: 13 August 2007 Location: United States Status: Offline Points: 930 |
![]() ![]() ![]() ![]() ![]() Posted: 11 January 2012 at 5:30pm |
When I add PNG and BMP resources to my project the IDE separates the two types of images in the resource view. I have a "Bitmap" and a "PNG" entry. So far so good.
But the IDE can assign the same resource ID to a BMP and a PNG resource. When I call CXTPImageManager::SetIcons, LoadBitmapFromResource is called. There I see this:
hModule = AfxFindResourceHandle(lpszResource, _T( "PNG"));When I am debugging, I see that even if I pass in an ID that is used only on a BMP resource, the call succeeds. Hence, when I am trying to load a BMP resource for which a PNG resource has been assigned the same ID, the image manager will load the PNG and not the BMP and that can cause problems since the wrong image has been loaded.
My only work-around appears to be to manually edit the values in resource.h. Is there a better way? |
|
![]() |
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 |