[問題] C++檔案錯誤無法開啟

看板C_and_CPP作者 (樹多村光)時間13年前 (2012/04/18 01:32), 編輯推噓2(202)
留言4則, 3人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) VC++2008 錯誤結果(Wrong Output): 建置成功 但案偵錯時卻不能開啟 跳出視窗 Debug Assertion Failed! Program:...18\My Documents\Visual Stadio 2008\Projects\123\Debug\123.exe File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winocc.cpp Line:329 For imformation on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. (Please Retry to debug the application) 中止(A) 重試(R) 略過(I) 程式碼(Code):(請善用置底文網頁, 記得排版) #include <afxwin.h> #include "resource.h" class CFirstFrame : public CFrameWnd { private: CMenu *FMenu; public: CFirstFrame() { Create(NULL, _T("Menu Resource Demo")); FMenu = new CMenu; FMenu->LoadMenu(IDR_MENU1); SetMenu(FMenu); } } ; class CFirstApp : public CWinApp { public: BOOL InitInstance() { CFrameWnd *Frame = new CFrameWnd(); m_pMainWnd = Frame; Frame->ShowWindow(SW_SHOW); return true; } } ; CFirstApp a_app; 補充說明(Supplement): 剛開始接觸式窗程式設計,請大家幫幫忙。 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.224.118

04/18 02:01, , 1F
Frame 指向物件,應該要呼叫 Create 才能完成視窗建立吧
04/18 02:01, 1F

04/18 02:27, , 2F
怎麼呼叫?
04/18 02:27, 2F

04/18 02:37, , 3F
Frame->Create(...) http://ppt.cc/dCGJ
04/18 02:37, 3F

04/18 02:44, , 4F
謝謝
04/18 02:44, 4F
文章代碼(AID): #1FZQa_Ba (C_and_CPP)