[問題] C++ MFC 開啟dialog錯誤

看板C_and_CPP (C/C++)作者 (JIM)時間10年前 (2015/07/07 19:32), 10年前編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) VC10 MFC 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 我有一個dialog,設置了一個按鈕來開啟第二個dialog 就會發生錯誤 " 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) " 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) toba3.h class Ctoshiba3Dlg : public CDialogEx Index.cpp void Index::OnBnClickedMember2(){ Ctoba3Dlg *mem=new Ctoba3Dlg; if(!(FindWindow(0,"toba3"))) mem->Create(IDD_TOSHIBA3_DIALOG, NULL); mem->ShowWindow(SW_SHOW); } 只要把這四句註解掉就不會錯誤了,兩個dialog分別執行也都可以 補充說明(Supplement): 請問有比較好的方法可以讓MFC可以做到類似網頁這樣上一頁下一頁 而不是直接開啟dialog或用tag control 謝謝!!! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.123.112.60 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1436268742.A.CE0.html

07/07 19:47, , 1F
我想到的是用linklist將dialog串在一起,不過好像也沒比
07/07 19:47, 1F

07/07 19:47, , 2F
較方便
07/07 19:47, 2F

07/07 19:48, , 3F
multiview & document
07/07 19:48, 3F
謝謝兩位提供的方法,我會在試看看! ※ 編輯: jiqian (140.123.112.60), 07/08/2015 10:26:40
文章代碼(AID): #1LcxZ6pW (C_and_CPP)
文章代碼(AID): #1LcxZ6pW (C_and_CPP)