MFC窗口创建及消息机制等

简介

最基础的MFC窗口需要CWinApp应用程序类和CFrameWnd窗口框架类。

创建过程

  1. 新建空的win32项目,并添加“mfc.cpp”和“mfc.h”两个源文件
  2. 在“mfc.h”中包含头文件“afxwin.h”(mfc的头文件)
    1
    #include <afxwin.h>
  3. 创建应用程序类MyApp,继承自CWinApp
    1
    2
    3
    4
    5
    class MyApp : public CWinApp
    {
    public:
    virtual BOOL InitInterface();
    }