MFC源码解读(一)最原始一个MFC程序,手写不用向导
生活随笔
收集整理的這篇文章主要介紹了
MFC源码解读(一)最原始一个MFC程序,手写不用向导
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
從這一篇開始,詳細記錄一下MFC的源碼解讀
四個文件,分別為:
stdafx.h,stdafx.cpp,hello.h,hello.cpp
代碼如下:
//stdafx.h #include <afxwin.h> //stdafx.cpp #include "stdafx.h" //hello.h class CMyWinApp:public CWinApp { public: BOOL InitInstance(); }; class CMyFrameWnd:public CFrameWnd { public:CMyFrameWnd(); }; //hello.cpp #include "stdafx.h" #include "hello.h"CMyWinApp theApp;BOOL CMyWinApp::InitInstance() {m_pMainWnd=new CMyFrameWnd();m_pMainWnd->ShowWindow(m_nCmdShow);m_pMainWnd->UpdateWindow();return TRUE; } CMyFrameWnd::CMyFrameWnd() {Create(NULL,"Hello MFC",WS_OVERLAPPEDWINDOW|WS_VSCROLL,CRect(40,60,900,300),NULL,"MainMenu"); }?
轉載于:https://www.cnblogs.com/tinaluo/p/9649480.html
總結
以上是生活随笔為你收集整理的MFC源码解读(一)最原始一个MFC程序,手写不用向导的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OrderOnline——设计概述
- 下一篇: css 设置背景色