⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_14470.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:14470 发表者:sunny 发表日期:2002-09-07 15:00:50
<br>主题:现有一CFormView视对应多个对话框模板,如何实现,高分征解
<br>内容:现有一CFormView视,它已对应一对话框模板,现要实现在视不变条件下动态改变对话框模板。请高手指教,不胜感激。<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:Wang Tao 回复日期:2002-09-11 08:54:44
<br>内容:可以实现吗?我一直都用多个VIEW,开始时一起创建,在SW_SHOW其中一个,其他的HIDE
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:凯凯 回复日期:2002-09-11 09:03:33
<br>内容:你说的情况应该针对每一个对话框模板建一个CFormView,然后在主框架中切换这些视。<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Wang Tao 回复日期:2002-09-11 10:49:50
<br>内容:或者用一个FORM,在用时自己往上动态添控件啦
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:凯凯 回复日期:2002-09-11 11:20:03
<br>内容:如果逻辑比较复杂,动态添加控件,要花费不少的精力来管理这些控件。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:西门吹雪 回复日期:2002-09-12 08:50:27
<br>内容:to凯凯:你前面说的就是我要做的,我现在要切换这些视,用Switchtoview.但我添加文档模板之后出现 debug assertion failed,不知怎么回事? <BR>。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Wang Tao 回复日期:2002-09-12 09:34:25
<br>内容:具体的CODE放上来,包括各个VIEW的引用和NEW之类的都要
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:凯凯 回复日期:2002-09-12 09:48:59
<br>内容:如果还涉及到文档类,是比较麻烦。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:西门吹雪 回复日期:2002-09-12 17:16:53
<br>内容:那是,要不我要他做什么,其实也不难,只是我对vc的机制还不是很熟。我只是照书上的例子加了这个,你们看看哪里有问题,能编译,但运行出错。<BR>BOOL CRobotApp::InitInstance()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;// CG: The following block was added by the Splash Screen component.<BR>\<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CCommandLineInfo cmdInfo;<BR>\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ParseCommandLine(cmdInfo);<BR>\<BR><BR>\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);<BR>\<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;AfxEnableControlContainer();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Standard initialization<BR>&nbsp;&nbsp;&nbsp;&nbsp;// If you are not using these features and wish to reduce the size<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;of your final executable, you should remove from the following<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;the specific initialization routines you do not need.<BR><BR>#ifdef _AFXDLL<BR>&nbsp;&nbsp;&nbsp;&nbsp;Enable3dControls();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Call this when using MFC in a shared DLL<BR>#else<BR>&nbsp;&nbsp;&nbsp;&nbsp;Enable3dControlsStatic();&nbsp;&nbsp;&nbsp;&nbsp;// Call this when linking to MFC statically<BR>#endif<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Change the registry key under which our settings are stored.<BR>&nbsp;&nbsp;&nbsp;&nbsp;// TODO: You should modify this string to be something appropriate<BR>&nbsp;&nbsp;&nbsp;&nbsp;// such as the name of your company or organization.<BR>&nbsp;&nbsp;&nbsp;&nbsp;SetRegistryKey(_T("Local AppWizard-Generated Applications"));<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;LoadStdProfileSettings();&nbsp;&nbsp;// Load standard INI file options (including MRU)<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Register the application's document templates.&nbsp;&nbsp;Document templates<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;serve as the connection between documents, frame windows and views.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;CMultiDocTemplate* pDocTemplate;<BR>&nbsp;&nbsp;&nbsp;&nbsp;pDocTemplate = new CMultiDocTemplate(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDR_ROBOTTYPE,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CRobotDoc),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CChildFrame), // custom MDI child frame<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CRobotView));<BR>&nbsp;&nbsp;&nbsp;&nbsp;AddDocTemplate(pDocTemplate);<BR>&nbsp;&nbsp;&nbsp;&nbsp;//自己添加的模板<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pForm= new CMultiDocTemplate(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDR_ROBOTTYPE,//这里有问题吗?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CRobotDoc),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CChildFrame), // custom MDI child frame<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(Form));<BR>&nbsp;&nbsp;&nbsp;&nbsp;AddDocTemplate(m_pForm);<BR>&nbsp;&nbsp;&nbsp;&nbsp;//自己添加的模板<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pForm1= new CMultiDocTemplate(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDR_ROBOTTYPE,//这里有问题吗?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CRobotDoc),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CChildFrame), // custom MDI child frame<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CAdverse));<BR>&nbsp;&nbsp;&nbsp;&nbsp;AddDocTemplate(m_pForm1);<BR>&nbsp;&nbsp;// create main MDI Frame window<BR>&nbsp;&nbsp;&nbsp;&nbsp;CMainFrame* pMainFrame = new CMainFrame;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (!pMainFrame-&gt;LoadFrame(IDR_MAINFRAME))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return FALSE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMainWnd = pMainFrame;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Parse command line for standard shell commands, DDE, file open<BR>&nbsp;&nbsp;&nbsp;&nbsp;CCommandLineInfo cmdInfo;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ParseCommandLine(cmdInfo);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Dispatch commands specified on the command line<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (!ProcessShellCommand(cmdInfo))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return FALSE;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// The main window has been initialized, so show and update it.<BR>&nbsp;&nbsp;&nbsp;&nbsp;//pMainFrame-&gt;ShowWindow(m_nCmdShow);<BR>&nbsp;&nbsp;&nbsp;&nbsp;pMainFrame-&gt;ShowWindow(SW_SHOWMAXIMIZED);<BR>&nbsp;&nbsp;&nbsp;&nbsp;pMainFrame-&gt;UpdateWindow();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;return TRUE;<BR>}
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:小戟 回复日期:2002-09-13 14:39:06
<br>内容:CMainFrame* pMainFrame = new CMainFrame;<BR>改为CMDIFrameWnd *pMainFrame = new CMDIFrameWnd ;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:西门吹雪 回复日期:2002-09-13 16:54:55
<br>内容:哈哈,小戟 回来了,在上海怎么样呀.终于又看到你了,这个论坛少了你还真的不行.看看前面的帖子就知道.<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:小戟 回复日期:2002-09-13 17:15:06
<br>内容:上海当然好了!想往中!前面的帖子是怎么回事?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:西门吹雪 回复日期:2002-09-13 18:41:15
<br>内容:行呀,俺也向往.<BR>我这几天在做切换视图的框架,你给的解答还真行.但是改了之后,一运行就出现一个不是我的程序里的对话框,以前没有碰到过的.<BR>前面,很少的人解答问题呀.当然凯凯和Wang Tao不算了&nbsp;&nbsp;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -