解决方法1:
CWnd* m_pCWnd = NULL;
在OnInitDialog里 m_pCWnd = AfxGetMainWnd();
解决方法2:
调用AfxGetMainWnd()的地方替换成AfxGetApp()->m_pMainWnd
编译后运行问题解决
本文介绍了在C++中通过两种不同的方式来获取应用程序主窗口实例的方法:一是直接使用AfxGetMainWnd()函数;二是通过AfxGetApp()->m_pMainWnd。这两种方法均可有效解决问题。
解决方法1:
CWnd* m_pCWnd = NULL;
在OnInitDialog里 m_pCWnd = AfxGetMainWnd();
解决方法2:
调用AfxGetMainWnd()的地方替换成AfxGetApp()->m_pMainWnd
编译后运行问题解决
5781

被折叠的 条评论
为什么被折叠?
