问题
I have a Win32 resource DLL (No MFC), which has a dialog in it.
I can load the Win32 dll using LoadLibrary
from the MFC application.
After loading the DLL, how do I bring up the dialog to show it to the user?
I Would appreciate if someone can share the code to do this.
I remember using AfxGetResourceHandle to do this kind of stuff, but don't remember it now.
回答1:
The basic steps are:
LoadLibrary
(as you have done)FindResource
(gives you an HRSRC)LoadResource
(gives you an HGLOBAL)LockResource
(gives you an LPVOID which you can cast to LPCDLGTEMPLATE)CreateDialogIndirectParam
(creates the dialog)
来源:https://stackoverflow.com/questions/13500136/displaying-a-dialog-resource-from-a-different-dll-in-mfc-application