vc++ 中OnDraw函数的问题

来源:百度知道 编辑:UC知道 时间:2024/05/27 04:26:40
我是vc++初学者,纳为高手帮忙看一下,谢谢了。我照书上做还是不知道错在哪里。

#include "stdafx.h"
#include "MfcApp.h"

#include "MfcAppDoc.h"
#include "MfcAppView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMfcAppView

IMPLEMENT_DYNCREATE(CMfcAppView, CView)

BEGIN_MESSAGE_MAP(CMfcAppView, CView)
//{{AFX_MSG_MAP(CMfcAppView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////

在工程的设置里面去掉预编译头文件的选项

project->settings->category->precompiled header

no using....

重建工程
Build->Rebuild All

在vc界面中使#inlude“stdafx.cpp”为当前活动页面,然后再bulid->complie stdafx.cpp,然后就可以正常运行了