Resource DLL
-
Hi, I am trying to make a dll for the images in my project. In the dll's project I add the resources (bitmaps) and I have functions to return HICONs, HBITMAPs, etc. But I can't create any image resources in my dll. In my resource.h I have #define IDB_02 5001 but when I do CBitmap dd; BOOL ret = dd.LoadBitmap(IDB_02)); "ret" is false. Do I have to include something else in a dll to make it work with images? Thanks ----- We are what we repeatedly do. Excellence, then, is not an act, but a habit.
-
Hi, I am trying to make a dll for the images in my project. In the dll's project I add the resources (bitmaps) and I have functions to return HICONs, HBITMAPs, etc. But I can't create any image resources in my dll. In my resource.h I have #define IDB_02 5001 but when I do CBitmap dd; BOOL ret = dd.LoadBitmap(IDB_02)); "ret" is false. Do I have to include something else in a dll to make it work with images? Thanks ----- We are what we repeatedly do. Excellence, then, is not an act, but a habit.
Before you call this, call
AfxSetResourceHandle()
to set the location of the resource, remembering to save the old one usingAfxGetResourceHandle()
HINSTANCE hOldRes = AfxGetResourceHandle();
AfxSetResourceHandle(hinstDLL); // hinstDLL is the instance handle of your DLL
CBitmap dd;
BOOL ret = dd.LoadBitmap(IDB_02);
AfxSetResourceHandle(hOldRes);Hope this helps, Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"