------------
Compiling...
Document_View_SDI.cpp
C:\Document_View_SDI\Document_View_SDI.cpp(10) : error C2146: syntax error : missing ';' before identifier 'AFX_MSGMAP'
C:\Document_View_SDI\Document_View_SDI.cpp(10) : error C2270: 'IMPLEMENT_DYNCRATE' : modifiers not allowed on nonmember functions
C:\Document_View_SDI\Document_View_SDI.cpp(10) : fatal error C1004: unexpected end of file found
這一個練習比較看不出來錯誤的地方,「IMPLEMENT_DYNCREATE」是對的,但是,
程式碼中
重點在於「BEGIN_MESSAGE_MAP(MyView, CView) 」出現兩次,也就是少了「BEGIN_MESSAGE_MAP(MyDocument, CDocument)」。


資源檔內的menu名稱也請修改為「IDR_MAINFRAME」,就可以順利執行,編譯後畫面如下:

沒有留言:
張貼留言