第一个MFC程序

1、Application.h

#pragma once
#include <afxwin.h>
class Application : public CWinApp
{
public:
     BOOL InitInstance();
};


2、Application.cpp

#include "Application.h"

BOOL Application::InitInstance() {
     CFrameWnd *frame = new CFrameWnd();
     this->m_pMainWnd = frame;
     frame->Create(NULL, TEXT("Hello MFC!!"));
     frame->ShowWindow(SW_SHOW);
     return true;
}

Application app;

运行结果:

Leave a Reply