编译环境:win2000、VC6++/sp5: // Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;我在CTestApp::InitInstance()中去掉了上述语句,怎么还是可以在资源管理器中双击文档打开?
ProcessShellCommand(cmdInfo)还有什么用?

解决方案 »

  1.   

    简单地说,就是分析你的运行程序的命令行参数,比如,你写了一个NotepadEx.exe,然后运行NotepadEx.exe test.txt,那么ProcessShellCommand()会检查到有test.txt这个参数,于是就会去打开这个文挡,否则,如果为空,则缺省情况下会自动打开一个空文档。
      

  2.   

    假设我的NotepadEx.exe可打开 test.txt,不要那些代码,在资源管理器中双击test.txt,一样可启动NotepadEx.exe打开test.txt。ProcessShellCommand(cmdInfo))还需要吗?
      

  3.   

    回复人: pcman1990(pcman) (  ) 信誉:110  2002-06-29 15:56:00  得分:0  
     
     
      简单地说,就是分析你的运行程序的命令行参数,比如,你写了一个NotepadEx.exe,然后运行NotepadEx.exe test.txt,那么ProcessShellCommand()会检查到有test.txt这个参数,于是就会去打开这个文挡,否则,如果为空,则缺省情况下会自动打开一个空文档。