在视图头文件里加一句:#include "mydlg.h"

解决方案 »

  1.   

    你在视图类中incluide这个“CMyDlg.h"了吗》
      

  2.   

    对了,我好像忘了可个头文件,谢谢!
    不过我加了,有如下错误:
    -Configuration: MyMsg - Win32 Debug--------------------
    Compiling...
    MyMsg.cpp
    c:\my documents\初级应用\mymsg\mymsgview.h(40) : error C2146: syntax error : missing ';' before identifier 'Dlg'
    c:\my documents\初级应用\mymsg\mymsgview.h(40) : error C2501: 'MyDlg' : missing storage-class or type specifiers
    c:\my documents\初级应用\mymsg\mymsgview.h(40) : error C2501: 'Dlg' : missing storage-class or type specifiers
    MyMsgView.cpp
    c:\my documents\初级应用\mymsg\mymsgview.h(40) : error C2146: syntax error : missing ';' before identifier 'Dlg'
    c:\my documents\初级应用\mymsg\mymsgview.h(40) : error C2501: 'MyDlg' : missing storage-class or type specifiers
    c:\my documents\初级应用\mymsg\mymsgview.h(40) : error C2501: 'Dlg' : missing storage-class or type specifiers
    C:\My Documents\初级应用\MyMsg\MyMsgView.cpp(113) : error C2065: 'Dlg' : undeclared identifier
    C:\My Documents\初级应用\MyMsg\MyMsgView.cpp(113) : error C2228: left of '.DoModal' must have class/struct/union type
    C:\My Documents\初级应用\MyMsg\MyMsgView.cpp(114) : error C2228: left of '.m_String' must have class/struct/union type
    Generating Code...
    Error executing cl.exe.MyMsg.exe - 9 error(s), 0 warning(s)
      

  3.   

    被充一句,上面的第3条错误中的Dlg是MyDlg的对象,MyDlg便是由对话框创建的新类了,请大家指教!!