#include "stdafx.h"
#include "MAPX基石.h"#include "MAPX基石Doc.h"
#include "MAPX基石View.h"
//#include "mapx.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CMAPXViewIMPLEMENT_DYNCREATE(CMAPXView, CView)BEGIN_MESSAGE_MAP(CMAPXView, CView)
//{{AFX_MSG_MAP(CMAPXView)
ON_WM_SIZE()
ON_WM_CREATE()
ON_WM_SETFOCUS()
//}}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()/////////////////////////////////////////////////////////////////////////////
// CMAPXView construction/destructionCMAPXView::CMAPXView()
{
// TODO: add construction code here}CMAPXView::~CMAPXView()
{
}BOOL CMAPXView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs return CView::PreCreateWindow(cs);
}/////////////////////////////////////////////////////////////////////////////
// CMAPXView drawingvoid CMAPXView::OnDraw(CDC* pDC)
{
CMAPXDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}/////////////////////////////////////////////////////////////////////////////
// CMAPXView printingBOOL CMAPXView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}void CMAPXView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}void CMAPXView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}/////////////////////////////////////////////////////////////////////////////
// CMAPXView diagnostics#ifdef _DEBUG
void CMAPXView::AssertValid() const
{
CView::AssertValid();
}void CMAPXView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}CMAPXDoc* CMAPXView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMAPXDoc)));
return (CMAPXDoc*)m_pDocument;
}
#endif //_DEBUG/////////////////////////////////////////////////////////////////////////////
// CMAPXView message handlersvoid CMAPXView::OnSize(UINT nType, int cx, int cy) 
{
CView::OnSize(nType, cx, cy);
m_ctrlMapX.MoveWindow(0, 0, cx, cy, TRUE);

// TODO: Add your message handler code here

}int CMAPXView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here

return 0;
}void CMAPXView::OnCreate(UINT nType, int cx, int cy)
{
m_ctrlMapX.Create(NULL, WS_VISIBLE, CRect(0, 0, 100, 100), this, IDC_MAP);
}void CMAPXView::OnSetFocus(CWnd* pOldWnd) 
{
CView::OnSetFocus(pOldWnd);
m_ctrlMapX.SetFocus();

// TODO: Add your message handler code here

}
抱错如题,请指点啊,别的例子也有这样的。