途径,只要用到 MFC 就一定要包含它。
#include "afxwin.h"
class CMyApp:public CWinApp //从 CWinApp 继承一个类 { public: virtual BOOL InitInstance();//重载 InitInstance 虚函数 }; class CMyFrame:public CFrameWnd //从 CFrameWnd 继承一个类 {};
CMyApp myApp; //最后又激活应用程序的构造函数
BOOL CMyApp::InitInstance () { m_pMainWnd=new CMyFrame; //new 激活了 C