【框架-MFC】MFC 应用程序 AfxGetMainWnd();在子线程中返回null

来源:互联网 发布:淘宝2017天天特价在哪 编辑:程序博客网 时间:2024/05/21 08:53

解决方法1:
CWnd* m_pCWnd = NULL;
在OnInitDialog里 m_pCWnd = AfxGetMainWnd();

解决方法2:
调用AfxGetMainWnd()的地方替换成AfxGetApp()->m_pMainWnd

编译后运行问题解决

0 0
原创粉丝点击