bitmap resource problem in DLL

Jul 2, 2009 at 5:31pm
hello, I have a main application and two DLL's, one that contains a set of functions to display bitmaps, and one that creates a thread that runs a splash screen. The DLL that runs the splash screen uses the other DLL to display the bitmaps a certain way. When I include the bitmaps in the resource of the splash DLL they won't load at all, but when I include the same bitmap in the resource script of the main executable, it works perfectly! I have no problem with just leaving it in the main exe for now so it works, but are there any reasons that it may be exhibiting this behavior?
Jul 2, 2009 at 6:06pm
How are you loading them?
Jul 6, 2009 at 7:38pm
they are loaded with LoadBitmap() using a resource ID (just an int identifier #define'd in a header)
Jul 6, 2009 at 9:59pm
You have to specify the DLL's HINSTANCE handle with LoadBitmap() -- since you are trying to load the bitmaps from that resource, not from your executable.

[edit] Oh yeah, You can use GetModuleHandle() to get the DLL's handle...

Have fun!
Last edited on Jul 6, 2009 at 10:01pm
Topic archived. No new replies allowed.