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

📄 subject_45854.htm

📁 vc
💻 HTM
字号:
<p>
序号:45854 发表者:super_xxx_xxx 发表日期:2003-07-04 11:17:02
<br>主题:救命!!!救命!!!救命!!!急!在线等待!!!
<br>内容:如何将一个定义好的CFormView显示出来
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:counter-bug 回复日期:2003-07-04 12:22:26
<br>内容:创建对象,ShowWindow(SW_SHOW)
<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>回复者:foolYan 回复日期:2003-07-04 12:24:41
<br>内容:两种case<BR>1:<BR>在你的WinApp::InitInstance()中<BR>BOOL CXXXApp::InitInstance()<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;CSingleDocTemplate* pDocTemplate;<BR>&nbsp;&nbsp;&nbsp;&nbsp;pDocTemplate = new CSingleDocTemplate(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDR_MAINFRAME,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CXXXDoc),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CMainFrame),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // main SDI frame window<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CXXXView));///将这里的CXXXView 该成你要显示的FormView名即可.<BR>&nbsp;&nbsp;&nbsp;&nbsp;AddDocTemplate(pDocTemplate);<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 one and only window has been initialized, so show and update it.<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMainWnd-&gt;ShowWindow(SW_SHOW);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMainWnd-&gt;UpdateWindow();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;return TRUE;<BR>}<BR>2:试验了1再说<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>
回复者:adam&amp;amp;ancy 回复日期:2003-07-04 12:40:24
<br>内容:强!<BR>to foolyan:<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>
回复者:foolYan 回复日期:2003-07-04 12:41:57
<br>内容:VC++
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:super_xxx_xxx 回复日期:2003-07-04 13:08:58
<br>内容: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;m_pMainWnd-&gt;ShowWindow(SW_SHOW);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMainWnd-&gt;UpdateWindow();<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>
回复者:foolYan 回复日期:2003-07-04 13:19:41
<br>内容:ParseCommandLine(cmdInfo); 解析程序的<BR>ProcessShellCommand(cmdInfo); 处理命令行如建立空,打开文档等。<BR>m_pMainWnd-&gt;ShowWindow(SW_SHOW);显示主窗口.<BR>m_pMainWnd-&gt;UpdateWindow();发重画(WM_PAINT)消息.<BR><BR>bye bye.<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>
回复者:super_xxx_xxx 回复日期:2003-07-04 13:35:14
<br>内容:谢谢,你的代码是在程序运行时显示的,但是我有多个formview需要用菜单选择,在菜单的处理函数中怎么将formview显示出来。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:super_xxx_xxx 回复日期:2003-07-04 14:00:36
<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>
回复者:风之文章 回复日期:2003-07-04 16:17:16
<br>内容:在vc源代码交流中我已回答了你这个问题<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>
回复者:foolYan 回复日期:2003-07-05 10:56:58
<br>内容:hi, man.<BR>如果你用了document view&nbsp;&nbsp;结构,这种情况不太好处理。我的做法是在CMainFrame中的OnCreateClient()中生成了各个view,不活动的View 隐藏起来。做法可能不是很专业但可以工作。由于时间不多,暂时没有想到更好的做法,例子中的实现也可能还有问题,仅供参考。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:super_xxx_xxx 回复日期:2003-07-07 09:34:44
<br>内容:你好xfyan,如果不用 docment view的结构,还有其他的方法可以使用CformView吗,或者还有其他的结构?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:super_xxx_xxx 回复日期:2003-07-07 16:53:26
<br>内容:&nbsp;&nbsp;&nbsp;&nbsp;1、在一个不支持 CDocument - CView的工程中,可以将一个CView 或是 CFormView显示出来吗?<BR>&nbsp;&nbsp;&nbsp;&nbsp;2、在一个多文档视窗的工程中怎样通过菜单方式将CFormView显示出来?<BR>&nbsp;&nbsp;&nbsp;&nbsp;3、如何销毁一个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>
回复者:foolYan 回复日期:2003-07-07 20:59:28
<br>内容:可以把任何view 当作一般的窗口来处理。使用view的RUNTIME_CLASS的CreateObject()来生成view 的实例,使用view的Create()函数来建立窗口.注意view窗口一定要在heap中生成:即只能用new或RUNTIME_CLASS中的CreateObject()来生成,因为在它的PostNCDestroy()中有delete this.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:super_xxx_xxx 回复日期:2003-07-08 09:33:24
<br>内容:谢谢 xfyan, 可不可以举个例子?<BR>我不清楚怎么用RUNTIME_CLASS的CreateObject()和view的Create(),然后再把view显示出来?<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>
回复者:foolYan 回复日期:2003-07-08 11:53:00
<br>内容:hi
<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 + -