AfxGetMainWnd()为什么返回NULL
来源:互联网 发布:白银现货交易软件 编辑:程序博客网 时间:2024/05/21 22:26
通常认为AfxGetMainWnd()会返回主窗口的指针。实际上有“前提条件”的。即返回当前调用AfxGetMainWnd()的线程的主窗口指针。
所以如果在程序的主线程中调用AfxGetMainWnd(),则返回程序(主线程)的主窗口指针。
如果在辅助线程(CreateThread)中调用AfxGetMainWnd(),则返回辅助线程的窗口指针,如果辅助线程没有创建窗口,则返回NULL。
即如果发现AfxGetMainWnd()返回NULL,则要先确认它是否在辅助线程中被调用。
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.
0 0
- AfxGetMainWnd()为什么返回NULL
- AfxGetMainWnd返回NULL
- AfxGetMainWnd返回NULL
- AfxGetMainWnd()返回NULL
- AfxGetMainWnd返回NULL也是可能的
- AfxGetMainWnd() return NULL
- 多线程AfxGetMainWnd() 返回空
- AfxGetMainWnd 返回值
- 【框架-MFC】MFC 应用程序 AfxGetMainWnd();在子线程中返回null
- 为什么findViewById会返回null
- 接入电信isag为什么返回null啊??
- AfxGetMainWnd()
- 为什么在mysql_query()返回成功后,mysql_store_result()有时返回NULL?
- 求救:为什么调用System.console()方法返回的是null?
- 为什么我调用Ajax服务端方法返回值总是null?
- request.getCharacterEncoding() 的返回值为什么会是null
- 为什么在mysql_query()返回成功后,mysql_store_result()有时会返回NULL
- 为什么NavigationContext为Null?
- 2.9 声音与特效
- 在C语言中引入了面向对象的思想
- CodeForces 550B Preparing Olympiad(状态压缩,暴搜)
- HDU-4920 Matrix multiplication
- 常见的C语言内存错误及对策
- AfxGetMainWnd()为什么返回NULL
- 对象的封装
- https://software.intel.com/zh-cn/blogs/2014/02/20/svn/
- PHP中 include, include_once, require, require_once的区别
- OpenCV中Adaboost训练的经验总结
- jQuery使用手册
- 单例模式的优点-缺点
- IOS开发UI阶段 第六周
- PHP实现一致性散列算法