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

📄 subject_15631.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:15631 发表者:lhbnj 发表日期:2002-09-19 23:44:01
<br>主题:能否定义一个对话框类可以调用多个对话框窗口?
<br>内容:能否定义一个对话框类,只要指定不同的对话框ID,可以调用不同的对话框窗口?<BR>当然,这些对话框中的控件ID是重复的!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:小戟 回复日期:2002-09-20 08:23:42
<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>
回复者:lhbnj 回复日期:2002-09-20 09:20:54
<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>回复者:Aikoc 回复日期:2002-09-20 17:06:45
<br>内容:BOOL CMEDesktopApp::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;UINT nIDD = IDD_MEDESKTOP_DIALOG;<BR>&nbsp;&nbsp;&nbsp;&nbsp;int nHeight = GetSystemMetrics(SM_CXMAXIMIZED);<BR>&nbsp;&nbsp;&nbsp;&nbsp;// 1024*768<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(nHeight &gt; 900)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nIDD = IDD_MEDESKTOP_DIALOG;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;// 800*600<BR>&nbsp;&nbsp;&nbsp;&nbsp;else if(nHeight &gt; 700)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nIDD = IDD_MEDESKTOP_DIALOG_800;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;// 640*480<BR>&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nIDD = IDD_MEDESKTOP_DIALOG_600;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;CMEDesktopDlg dlg(NULL,nIDD);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMainWnd = &dlg;<BR>&nbsp;&nbsp;&nbsp;&nbsp;int nResponse = dlg.DoModal();<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (nResponse == IDOK)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO: Place code here to handle when the dialog is<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;dismissed with OK<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;else if (nResponse == IDCANCEL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO: Place code here to handle when the dialog is<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;dismissed with Cancel<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Since the dialog has been closed, return FALSE so that we exit the<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;application, rather than start the application's message pump.<BR>&nbsp;&nbsp;&nbsp;&nbsp;return FALSE;<BR>}<BR>
<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 + -