高手帮忙解决问题
// ResultView.cpp : implementation file//
#include "stdafx.h"
#include "query tool.h"
#include "ResultView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResultView
IMPLEMENT_DYNCREATE(CResultView, CView)
CResultView::CResultView()
{
}
CResultView::~CResultView()
{
}
BEGIN_MESSAGE_MAP(CResultView, CView)
//{{AFX_MSG_MAP(CResultView)
ON_WM_CREATE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResultView drawing
void CResultView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CResultView diagnostics
#ifdef _DEBUG
void CResultView::AssertValid() const
{
CView::AssertValid();
}
void CResultView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CResultView message handlers
int CResultView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CRect rect;
this->GetWindowRect(&rect);
this->ScreenToClient(rect);
if(!m_DataGrid.Create(NULL,NULL,WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL,rect,this,[color=Red]ID_DATAGRID[/color]))
TRACE("Failed to create GridCtrl.\n");
m_DataGrid.SetBackColor((unsigned long)RGB(255,255,255));
m_DataGrid.SetBorderStyle((unsigned long)0);
m_DataGrid.SetAllowRowSizing((long)1);
m_DataGrid.ShowWindow(SW_SHOW);
return 0;
}
void CResultView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(m_DataGrid&&m_DataGrid.m_hWnd!=NULL)
m_DataGrid.MoveWindow(0,0,cx,cy);
}
错误提示:
Compiling...
ResultView.cpp
G:\query tool\ResultView.cpp(71) : error C2065: 'ID_DATAGRID' : undeclared identifier
执行 cl.exe 时出错.
query tool.exe - 1 error(s), 0 warning(s)