最简单的MFC程序

2014-11-11 08:45:06 · 作者: · 浏览: 35

  建立一个Win32空项目后,然后手工打造的最简单的MFC程序:


  1: //stdafx.h


  2: #pragma once


  3: #include


  4: #include


  5: #include


  6: #include 1: //stdafx.cpp


  2: #include "stdafx.h" 1: //MainApp.h


  2: #pragma once


  3: class CMainApp : public CWinAppEx


  4: {


  5: public:


  6: virtual BOOL InitInstance();


  7: }; 1: //MainApp.cpp


  2: #include "stdafx.h"


  3: #include "MainApp.h"


  4: #include "MainWindow.h"


  5:


  6: CMainApp mianApp;


  7:


  8: BOOL CMainApp::InitInstance()


  9: {


  10: CWinAppEx::InitInstance();


  11:


  12: SetRegistryKey(TEXT("Hello MFC app."));