求助各位高手,我在编辑我的一个对话框cpp文件时出现下面错误,这是为什么啊?搞不懂啊,我只是想获得视图类的指针并获取其数据啊,为什么会出错啊?高手请指点我该怎样才能获得视图类CModgraphView*的指针啊?class CModelDlg : public CDialog
{
// Construction
public:
CModelDlg(CWnd* pParent = NULL); // standard constructor
CModgraphView* GetActiveView();
............
}
.................\modeldlg.h(18) : error C2143: syntax error : missing ';' before '*'
.................\modeldlg.h(18) : error C2501: 'CModgraphView' : missing storage-class or type specifiers
.................\modeldlg.h(18) : error C2501: 'GetActiveView' : missing storage-class or type specifiers

解决方案 »

  1.   

    是不是CModgraphView得头文件没有包含啊
      

  2.   

    包含include "ModgraphView.h"CModgraphView* GetActiveView();这个函数怎么在这里写呢,不应该在view中写吗
      

  3.   

    对话框可以使用视图吗?
    @#$%^&*学习!!!!!!
      

  4.   

    哎,
    终于搞懂了,
    mmd,眼睛都看花了!
    获取视力指针是这样的:
    CMainFrame * m_Frame=(CMainFrame*)(AfxGetApp()->m_pMainWnd);
    CModgraphView* m_pView=(CModgraphView*)m_Frame->GetActiveView();另那个编译错误可搞不懂!!!
    把它注了再打开!!!