AfxGetMainWnd 与 theApp.GetMainWnd()
来源:互联网 发布:少年包青天3结局 知乎 编辑:程序博客网 时间:2024/05/22 02:35
一般情况下:
如果是主线程中应用:
1:对话框程序,获取的是主窗口;
2:文档程序获取的是主框架;
AfxGetMainWnd 与 theApp.GetMainWnd()没有什么区别;
但是在辅助线程中应用,就有区别:
If AfxGetMainWnd is called from the application's primary thread, it returns the application's main window according to the above rules. If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that made the call.
也就是说AfxGetMainWnd在一般的辅助线程中应为没有界面,所以返回NULL;这是可以通过theApp.GetMainWnd()获取主界面,这具体可参考MFC源码;
- AfxGetMainWnd 与 theApp.GetMainWnd()
- AfxGetApp->GetMainWnd()与AfxGetMainWnd
- AfxGetApp->GetMainWnd()与AfxGetMainWnd
- AfxGetApp->GetMainWnd()与AfxGetMainWnd
- AfxGetApp->GetMainWnd()与AfxGetMainWnd
- AfxGetApp->GetMainWnd()与AfxGetMainWnd
- AfxGetApp->GetMainWnd()与AfxGetMainWnd
- AfxGetApp->GetMainWnd()与AfxGetMainWnd的不同
- AfxGetApp()->GetMainWnd与AfxGetMainWnd的区别
- 前台线程与后台线程,AfxGetApp->GetMainWnd()与AfxGetMainWnd的不同
- AfxGetApp()->GetMainWnd()和AfxGetMainWnd()的区别
- AfxGetApp()->GetMainWnd()和AfxGetMainWnd()的区别
- AfxGetMainWnd与AfxGetApp->m_pMainWnd
- AfxGetMainWnd()
- afxgetapp->afxmainwnd 与afxgetmainwnd的区别 /线程中调用afxgetmainwnd的问题
- AfxGetApp() GetMainWnd()
- 多线程与AfxGetMainWnd的吐血遭遇……
- 多线程与AfxGetMainWnd的吐血遭遇……
- UML序列图总结
- 我们来聊聊生活中的指针
- 回溯法求解数独题目
- 一个简单的Linux驱动程序和Makefile
- trying to install xdebug: configure file not found
- AfxGetMainWnd 与 theApp.GetMainWnd()
- 优化临时表使用,SQL语句性能提升100倍
- iOS设计模式(02):单例模式
- Android使用AttributeSet自定义控件的方法
- 获取linux硬件配置信息脚本
- Ojective-c 单例模式的另一种
- JSON
- 如何修改linux启动配置
- mysql 有用命令执行