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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值