AfxGetApp()->m_pMainWnd和AfxGetMainWnd() 的区别

来源:互联网 发布:linux ide 编辑:程序博客网 时间:2024/04/29 13:33

在多线程程序中

AfxGetApp()->m_pMainWnd 应用程序主线程的句柄,在一个多线程应用程序中是唯一的

AfxGetMainWnd() 调用线程的句柄,暨当前语句所在线程的句柄,不唯一。



   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
原创粉丝点击