第一个MFC程序
- Windwos 10 1809(LTSC)
- Visual Studio 2013
project wizard
Create an empty Win32 project.

click Empty Project

Generate using the class wizard
- CMainWindow

- CMyApp

Note:
You need to include "<afxwin.h>" in all header files.
add window caption - MainWindow
CMainWindow::CMainWindow()
{
Create(NULL, _T("Hello MFC"));
}
add initial instance - MyApp
- declare
public:
virtual BOOL InitInstance();
- impl
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMainWindow();
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
done
Add it to MyApp.cpp
CMyApp myApp;
Use MFC In a Static Library

浙公网安备 33010602011771号