在你的工程的CWinApp派生类的InitInstance()方法中有如下代码(自动生成的):
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
cmdInfo中有相关信息,其中cmdInfo.m_strFileName为文件名。
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
cmdInfo中有相关信息,其中cmdInfo.m_strFileName为文件名。
{
CString m_strFileName;
CString m_strTemp = CString(m_lpCmdLine);
if(m_lpCmdLine[0] == '\"')
m_strFileName = m_strTemp.Mid(1, m_strTemp.GetLength() - 2);
else
m_strFileName = m_strTemp;
}
In this sample the variable m_strFileName is the file name you clicked in explore.Best wishes
------