我建了一个基于SDI的工程,建好以后新建一个对话框,根据这个对话框生成Dialog1.cpp和 Dialog1.h,然后新建一个菜单项,运行的时候单击它就弹出对话框。 我要在Dialog中得到视图的指针,但是★在Dialog1.cpp中嵌入***View.h会报错★,
错误如下:
error C2143: syntax error : missing ';' before '*'
error C2501: 'C***Doc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers 要想在Dialog.cpp中得到视图的指针应该怎样做??
错误如下:
error C2143: syntax error : missing ';' before '*'
error C2501: 'C***Doc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers 要想在Dialog.cpp中得到视图的指针应该怎样做??
{
CExdlg dlg(this->GetActiveView());
dlg.DoModal();
}class CMfcex1View;
class CExdlg : public CDialog
{
// Construction
public:
CExdlg(CWnd* pParent = NULL); // standard constructor CExdlg(CMfcex1View * pView); // standard constructor
CEx1View * m_pView;
..
}CExdlg::CExdlg(CMfcex1View *pView)
: CDialog(CExdlg::IDD, NULL)
{
//{{AFX_DATA_INIT(CExdlg)
m_pView = pView;
//}}AFX_DATA_INIT
}
-----------------------------------
我在Dialog.cpp里的函数里,用m_pView->Invalidate(TRUE);怎么报错啊?
错误:
error C2027: use of undefined type 'CDateJishuView'
error C2227: left of '->Invalidate' must point to class/struct/union