|
BOOL CMyApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CMyDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { } else if (nResponse == IDCANCEL) { } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; } 其中m_pMainWnd = &dlg;语句运行不下去了 出现对话框提示:Unhandle exception in xxx.exe:0XC0000005:Access Violation. 哪位大哥知道是怎么回事帮帮小弟 |
|
|
|
估计问题会在CMyDlg的构造函数或Create函数中,自己添加的代码有问题
|
|
|
都是向导生成的代码,没问题.先Rebuild All试一下.再有可能得打什么补丁了.
|
|
|
Rebuild All一下确实可以解决问题,akiko谢谢了。这是什么原因呢?做成可执行程序后会不会又出现这种问题啊?
|
|