------------
Compiling...
6_.cpp
c:\6_\6_.cpp(12) : error C2146: syntax error : missing ';' before identifier 'AFX_MSGMAP'
c:\6_\6_.cpp(12) : error C2270: 'IMPLEMENT_SYNCREATE' : modifiers not allowed on nonmember functions
c:\6_\6_.cpp(12) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
重點在於「IMPLEMENT_SYNCREATE」,所以檢測語法,發現到多個語法寫錯,
正確語法應該為「IMPLEMENT_DYNCREATE」,附上程式碼錯誤的畫面:

這裡也請留意「ON_COMMAND 」語法錯誤

而「m_pMainWnd = pDocTemplate->CreateNewFrame( doc, NULL )」建立的對象也寫錯了。

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

1 則留言:
謝謝老師!!
原來是我太粗心~
謝謝謝謝
張貼留言