[问题] C++ MFC 开启dialog错误

楼主: jiqian (JIM)   2015-07-07 19:32:19
开发平台(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
谢谢!!!
作者: EdisonX (卡卡兽)   2015-07-07 19:47:00
我想到的是用linklist将dialog串在一起,不过好像也没比较方便
作者: flyfoxy (飞狐)   2015-07-07 19:48:00
multiview & document

Links booklink

Contact Us: admin [ a t ] ucptt.com