CWnd与CWinThread

来源:互联网 发布:股票盯盘系统公式源码 编辑:程序博客网 时间:2024/06/10 09:07

CWinThread和CWnd都是继承于CCmdTarget,CCmdTarget是继承于CObject。

 

CWinThread的子类有CWinApp,这个类代表应用程序。

CWnd的子类有 CFramewindows,Dialog,View,Controls,这些类都是与框架,可视化有关,即我们用户所见的界面。

 

CWnd中有成员m_hWnd,这是一个指向窗口的句柄。注意,广义地说一个按钮也算是一个窗口。

CWinThread中有成员m_pMainWnd,这是一个指向主窗口的指针,当m_pMainWnd指向的窗口被关闭时,MFC库会自动结束相关进程。m_pMainWnd是一个声明为public的,类型为CWnd* 的变量。也就是说他是一个CWinThread里指向窗口的指针变量。

 

CWinThread的data members有:

m_bAutoDelete

Specifies whether to destroy the object at thread termination.

m_hThread

Handle to the current thread.

m_nThreadID

ID of the current thread.

m_pActiveWnd

Pointer to the main window of the container application when an OLE server is in-place active.

m_pMainWnd

Holds a pointer to the application's main window.

 

CWnd的data member只有:

m_hWnd

Indicates the HWND attached to this CWnd.

 

原创粉丝点击