大家帮忙看看这个程序是怎么弄出来的
本人学vc不久 今天看了一个程序 里面有MFC的消息映射 可是又没有View类MainFrame类 跟MFC AppWizard 长生出来的源代码又不一样 小弟就不知道是怎么办了 哪位达人帮忙看看 谢了
以下是这个程序的源代码,头文件没有贴出来
只有两个类canvasApp 和 canvasFrame
// canvasApp.cpp: implementation of the canvasApp class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "canvasr.h"
#include "canvasApp.h"
#include "canvasFrame.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
canvasApp canvas;
canvasApp::canvasApp()
{
}
canvasApp::~canvasApp()
{
}
canvasApp::InitInstance()
{
m_pMainWnd = new canvasFrame;
m_pMainWnd->ShowWindow( m_nCmdShow );
m_pMainWnd->UpdateWindow();
return true;
}
// canvasFrame.cpp : implementation file
//
#include "stdafx.h"
#include "canvasr.h"
#include "canvasFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// canvasFrame
IMPLEMENT_DYNCREATE(canvasFrame, CFrameWnd)
canvasFrame::canvasFrame()
{
RECT rect;
Create(NULL,"绘图窗口");
CClientDC dc(this);
int width = dc.GetDeviceCaps(HORZRES);
int height = dc.GetDeviceCaps(VERTRES);
GetWindowRect( &rect );
width = ( width - ( rect.right - rect.left ))/2 ;
height = (height - (rect.bottom - rect.top ))/2 ;
MoveWindow( width , height , (rect.right - rect.left ) , (rect.bottom - rect.top ) ,true);
}
canvasFrame::~canvasFrame()
{
}
BEGIN_MESSAGE_MAP(canvasFrame, CFrameWnd)
//{{AFX_MSG_MAP(canvasFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// canvasFrame message handlers