2012年11月15日

关于对话框DoModal()函数调用失败的原因分析

摘要: 原文地址:http://www.cnblogs.com/carekee/articles/1749365.html对话框DoModal()函数调用失败一般而言有两种表现形式:一是对话框弹不出来,但是没有错误提示;二是对话框弹不出来,同时伴随内存访问错误的提示框出现。第一种表现主要是因为没有对资源句柄进行切换造成的,以在DLL中弹出对话框中最为常见。解决办法是:如果是MFC规则DLL,可以使用所有导出函数的开始处添加 AFX_MANAGE_STATE宏,具体代码为:AFX_MANAGE_STATE(AfxGetStaticModuleState( ))。如果是MFC扩展DLL,具体做法是:1. 阅读全文

posted @ 2012-11-15 10:42 zhuyf87 阅读(3018) 评论(0) 推荐(0) 编辑

CDialog_DoModal返回-1,无法创建Dialog

摘要: CDialog::DoModalReturn Value:An int value that specifies the value of the nResult parameter that was passed to the CDialog::EndDialog member function, which is used to close the dialog box. The return value is –1 if the function could not create the dialog box, or IDABORT if some other error occurre 阅读全文

posted @ 2012-11-15 10:34 zhuyf87 阅读(896) 评论(0) 推荐(0) 编辑

导航