Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
212 views
Welcome To Ask or Share your Answers For Others

1 Answer

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)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...