Displaying a dialog resource from a different DLL

2019-09-21 19:38发布

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条回答
相关推荐>>
2楼-- · 2019-09-21 19:54

The basic steps are:

  1. LoadLibrary (as you have done)
  2. FindResource (gives you an HRSRC)
  3. LoadResource (gives you an HGLOBAL)
  4. LockResource (gives you an LPVOID which you can cast to LPCDLGTEMPLATE)
  5. CreateDialogIndirectParam (creates the dialog)
查看更多
登录 后发表回答