| 星期日 | 星期一 | 星期二 | 星期三 | 星期四 | 星期五 | 星期六 |
1 | 2 請勿安排課程 | 3 | 4 | |||
5 | 6 | 7 重慶C#-6 | 8 | 9 重慶C#-7 | 10 | 11 東區VB-6-7 |
12 | 13 | 14 重慶C#-8 | 15 | 16 重慶C#-9 | 17 | 18 東區VB-8-9 |
19 請勿安排課程 | 20 | 21 重慶C#-10 | 22 | 23 重慶ACCESS2007-1 | 24 重慶_預排C#包班-1 | 25 東區VB-10 |
26 請勿安排課程 | 27 寫稿中... | 28 重慶ACCESS2007-2 | 29 寫稿中... | 30 重慶ACCESS2007-3 | ||
博客來網路書店查詢
星期五, 3月 06, 2009
2009年4月份課表
星期一, 3月 02, 2009
VC課程中出現錯誤訊息的學員作品分析-3
VC課程中出現錯誤訊息的學員作品分析-2
這裡以「Document_View_SDI」這一個專案分析,編譯時出現了以下的錯誤訊息:
------------
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)」。
另外,「doc = pDocTemplate->CreateNewDocument();」有錯,所以修改後就可編譯。

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

------------
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)」。
另外,「doc = pDocTemplate->CreateNewDocument();」有錯,所以修改後就可編譯。
資源檔內的menu名稱也請修改為「IDR_MAINFRAME」,就可以順利執行,編譯後畫面如下:

VC課程中出現錯誤訊息的學員作品分析-1
這裡以「6_」這一個專案分析,編譯時出現了以下的錯誤訊息:
------------
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」,就可以順利執行,邊後後畫面如下:
------------
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」,就可以順利執行,邊後後畫面如下:
訂閱:
文章 (Atom)
