1)去软件区下载,叫什么语法编辑器 2) 在前面的MDI程序中,当应用程序启动时,都会自动创建一个空白窗口。但有时我们并不希望创建这样的空白窗口。比如,对于一个文件浏览器来说,空白窗口就没有什么意义。要防止空白窗口的创建,首先就要明白这个窗口是如何被创建的。在InitInstance()中,有一个命令行的执行过程,当命令行上没有参数时,函数ParseCommandLine(cmdInfo)会将CCommandLineInfo::m_nShellCommand成员置为CCommandLineInfo::FileNew,这将导致ProcessShellCommand调用CWinApp::OnFileNew成员函数。要想防止程序开始时就调用OnFileNew,解决方法之一是去掉与命令行有关的代码,但是这样就没有了命令行处理功能。另一种方法是在ProcessShellCommand调用之前加一句cmdInfo.m_nShellCommand =CCommandLineInfo::FileNothing。具体代码见清单8.12。清单8.12 不自动创建空白文档窗口的InitInstance成员函数定义BOOL CDrawApp::InitInstance(){// Enable DDE Execute openEnableShellOpen();RegisterShellFileTypes(TRUE);// Parse command line for standard shell commands, DDE, file openCCommandLineInfo cmdInfo;// Alter behaviour to not open window immediately cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;ParseCommandLine(cmdInfo);// Dispatch commands specified on the command lineif (!ProcessShellCommand(cmdInfo))return FALSE;//......}
o . .- .- ./ .--... o .-------- $ .-- o o / ....... ' .. o o o '........ ---- o . --.. o o o . .---.. - o . ' -. o o / ' o 分 / ' ' ' \-----/....... . ' ' ' ' \ __/ - - -' ' ' ' ' ' ' ' o ' ' ' ' ' ' ' -..'.----------. I ---------- /////////.
2)
在前面的MDI程序中,当应用程序启动时,都会自动创建一个空白窗口。但有时我们并不希望创建这样的空白窗口。比如,对于一个文件浏览器来说,空白窗口就没有什么意义。要防止空白窗口的创建,首先就要明白这个窗口是如何被创建的。在InitInstance()中,有一个命令行的执行过程,当命令行上没有参数时,函数ParseCommandLine(cmdInfo)会将CCommandLineInfo::m_nShellCommand成员置为CCommandLineInfo::FileNew,这将导致ProcessShellCommand调用CWinApp::OnFileNew成员函数。要想防止程序开始时就调用OnFileNew,解决方法之一是去掉与命令行有关的代码,但是这样就没有了命令行处理功能。另一种方法是在ProcessShellCommand调用之前加一句cmdInfo.m_nShellCommand =CCommandLineInfo::FileNothing。具体代码见清单8.12。清单8.12 不自动创建空白文档窗口的InitInstance成员函数定义BOOL CDrawApp::InitInstance(){// Enable DDE Execute openEnableShellOpen();RegisterShellFileTypes(TRUE);// Parse command line for standard shell commands, DDE, file openCCommandLineInfo cmdInfo;// Alter behaviour to not open window immediately cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;ParseCommandLine(cmdInfo);// Dispatch commands specified on the command lineif (!ProcessShellCommand(cmdInfo))return FALSE;//......}
o . .- .-
./ .--...
o .-------- $ .--
o o / .......
' ..
o o o '........ ----
o . --..
o o o . .---.. -
o . ' -.
o o / '
o 分 / ' ' '
\-----/....... . ' ' ' '
\ __/ - - -' ' ' '
' ' ' '
o ' ' ' '
' ' '
-..'.----------.
I ----------
/////////.