Create a window with the shortest MFC code

zhaozj2021-02-16  54

code show as below

Document 1: stdafx.cpp

#include "stdafx.h"

File 2: stdafx.h

#include

Document 3: minmfcwin.cpp

#include "stdafx.h"

Class cmfcapp: public cwinapp {public: virtual bool initinstance ();

CMFCapp theApp;

Class CMAINFRAME: PUBLIC CFRAMEWND {public: cmainframe ();

Bool cmfcapp :: InitInstance () {m_pmainwnd = new cmainframe (); m_pmainwnd -> showwindow; m_pmainwnd -> UpdateWindow ();

Return True;}

CMAINFRAME :: CMAINFRAME () {// Create Window Create (Null, "Minimal MFC Window", WS_OVERLAPPEDWINDOW, CRECT (0, 0, 200, 200));

转载请注明原文地址:https://www.9cbs.com/read-18575.html

New Post(0)