dll创建无模式对话框
来源:互联网 发布:程序员转正答辩演讲稿 编辑:程序博客网 时间:2024/06/04 18:30
由资源冲突造成的,可以这样解决
在DllMain函数所在的cpp文件中定义一个全局变量
HINSTANCE g_hInstance;
在DllMain函数的
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("DOCUSERTOOLS.DLL Initializing!/n");
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(DocUserToolsDLL, hInstance))
return 0;
这几句之后加入
g_hInstance = hInstance;
然后在你的DLL导出函数所在的cpp文件中加入如下定义
extern HINSTANCE g_hInstance;
即使用上面所定义的全局变量
然后加入如下宏定义
#define BEGININSTANCE HINSTANCE hOldInstance = ::AfxGetResourceHandle();::AfxSetResourceHandle(g_hInstance);
#define ENDINSTANCE ::AfxSetResourceHandle(hOldInstance);
将这几句
theApp.pMyDlg = new CMyDlg(pParentWnd);
theApp.pMyDlg->Create(IDD_MYDLG,pParentWnd);
theApp.pMyDlg->ShowWindow(SW_SHOW);
改为这样
BEGININSTANCE
theApp.pMyDlg = new CMyDlg(pParentWnd);
theApp.pMyDlg->Create(IDD_MYDLG,pParentWnd);
theApp.pMyDlg->ShowWindow(SW_SHOW);
ENDINSTANCE
- dll创建无模式对话框
- 创建无模式对话框
- 创建无模式对话框
- 创建无模式对话框
- 如何创建无模式对话框
- MFC创建有模式对话框和无模式对话框
- 模式对话框和无模式对话框的创建总结
- 无模式对话框的创建分析 (copy)
- 无模式对话框的创建与使用
- 如何创建和使用无模式对话框
- 无模式对话框的创建与使用
- 如何创建和使用无模式对话框
- 无模式对话框的创建与使用(转自VCKBase)
- Dll 中创建非模式对话框 报错
- dll中创建非模式对话框的问题
- 无模式对话框
- 无模式对话框
- 建立无模式对话框
- 2009 KungFu Rails大会JRuby演讲PPT
- Remoting
- 通过OpenNetCF来获取周围的Wifi设备以及信号强度
- SWT 图像处理入门
- 汇编写的一个冒泡排序
- dll创建无模式对话框
- 分页(Oracle)
- CentOS5.3安装Oracle10g 小记
- fedora11 安装 Vmwar Tools
- 转:MFC的模块状态(AfxGetApp()和AFX_MANAGE_STATE())
- sprintf()函数的用法
- 学习mfc的一些方法
- 123456789 —— 数字原来很奇妙
- MySQL处理同时存在order by 和 limit 语句时出现的bug