Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ressources in a MFC-Extension-DLL

Status
Not open for further replies.

SebastianStricker

Programmer
Aug 28, 2003
10
DE
Hello,

I just wanted to make an MFC-extension DLL out of some source code that was included in a common SDI-project. I put the files to the new DLL-project an exported the classes via AFX_EXT_CLASS (don't know if this is the best solution but it works).
I also added the old ressources (some bitmaps) to the new DLL project, but they aren't loaded correctly. I used this to load the ressource called "IDB_RESIZE":

m_hResizeBitmap = ::LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDB_RESIZE), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR|LR_LOADTRANSPARENT);

I guess I need another call to get the correct instance handle since I'm now in a DLL-project(?). Can anyone help me?

Thanks, Sebastian.
 
You need the instance of your DLL, not the application, since that is where the resources are. Not sure if this will work, but maybe:
LoadImage(GetModuleHandle(NULL), ...);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top