在MFC应用程序中显示来自不同DLL的对话资源 [英] Displaying a dialog resource from a different DLL in MFC application
本文介绍了在MFC应用程序中显示来自不同DLL的对话资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以使用 LoadLibrary加载Win32 dll
加载DLL后,如何将对话框显示给用户?
如果有人可以共享代码,我将不胜感激。
我记得使用 AfxGetResourceHandle 做这样的东西,但现在不记得了
解决方案
基本步骤是:
-
LoadLibrary
(如你所做) -
FindResource
你是HRSRC) -
LoadResource
(给你一个HGLOBAL) -
LockResource
(为您提供一个您可以转换为LPCDLGTEMPLATE的LPVOID) -
CreateDialogIndirectParam
(创建对话框)
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.
解决方案
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)
这篇关于在MFC应用程序中显示来自不同DLL的对话资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文