我建立了一个基于MFC的多文档的程序MyMoredoc,第一次运行后,我将其保存为:
moredoc.lhw。以后我希望再运行时直接打开moredoc.lhw。我知道因在CMyMoredocApp类的InitInstance函数中操作,可能是操作以下两条语句申明的类。
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
但忘了怎么作。谢谢高手指教。!!
moredoc.lhw。以后我希望再运行时直接打开moredoc.lhw。我知道因在CMyMoredocApp类的InitInstance函数中操作,可能是操作以下两条语句申明的类。
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
但忘了怎么作。谢谢高手指教。!!
那么,你在ParseCommandLine(cmdInfo);后面加上这句话就可以了
if(cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew||
cmdInfo.m_nShellCommand==CCommandLineInfo::FileNothing)
{
OpenDocumentFile(docName);
}
并注意把后面的ProcessShellCommand(cmdInfo);屏蔽掉。