码迷,mamicode.com
首页 > 编程语言 > 详细

MFC源码解读(一)最原始一个MFC程序,手写不用向导

时间:2018-09-15 00:34:56      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:开始   return   color   bsp   详细   menu   ram   size   cpp   

从这一篇开始,详细记录一下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");
}

 

MFC源码解读(一)最原始一个MFC程序,手写不用向导

标签:开始   return   color   bsp   详细   menu   ram   size   cpp   

原文地址:https://www.cnblogs.com/tinaluo/p/9649480.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!