📄 subject_62227.htm
字号:
<p>
序号:62227 发表者:巴拉克 发表日期:2003-11-25 14:02:28
<br>主题:如何将程序终止
<br>内容:一个SDI的程序中有一个Dialog,现在我想首先运行Dialog,然后运行SDI,像登陆密码校验那样。可是我发现cancel的时候,也一样运行了SDI,不知道如何在此终止程序,谢谢大家
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:秋叶禅 回复日期:2003-11-25 14:10:01
<br>内容:在InitInstance中<BR>加入:<BR>if(Mydlg.DoModal() == IDOK)<BR>{ <BR> if 密码正确<BR> {<BR> AfxEnableControlContainer();<BR><BR> // Standard initialization<BR> // If you are not using these features and wish to reduce the size<BR> // of your final executable, you should remove from the following<BR> // the specific initialization routines you do not need.<BR><BR>#ifdef _AFXDLL<BR> Enable3dControls(); // Call this when using MFC in a shared DLL<BR>#else<BR> Enable3dControlsStatic(); // Call this when linking to MFC statically<BR>#endif<BR><BR> // Change the registry key under which our settings are stored.<BR> // TODO: You should modify this string to be something appropriate<BR> // such as the name of your company or organization.<BR> SetRegistryKey(_T("Local AppWizard-Generated Applications"));<BR><BR> LoadStdProfileSettings(); // Load standard INI file options (including MRU)<BR><BR> // Register the application's document templates. Document templates<BR> // serve as the connection between documents, frame windows and views.<BR><BR> CSingleDocTemplate* pDocTemplate;<BR> pDocTemplate = new CSingleDocTemplate(<BR> IDR_MAINFRAME,<BR> RUNTIME_CLASS(CDdddDoc),<BR> RUNTIME_CLASS(CMainFrame), // main SDI frame window<BR> RUNTIME_CLASS(CDdddView));<BR> AddDocTemplate(pDocTemplate);<BR><BR> // Parse command line for standard shell commands, DDE, file open<BR> CCommandLineInfo cmdInfo;<BR> ParseCommandLine(cmdInfo);<BR><BR> // Dispatch commands specified on the command line<BR> if (!ProcessShellCommand(cmdInfo))<BR> return FALSE;<BR><BR> // The one and only window has been initialized, so show and update it.<BR> m_pMainWnd->ShowWindow(SW_SHOW);<BR> m_pMainWnd->UpdateWindow();<BR><BR> return TRUE;<BR> }<BR> }<BR>ELSE<BR>{<BR> return false;<BR>}<BR><BR>2003-11-25 14:13:11
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -