你的第一个问题可以翻书《输入浅出MFC》的第590页,有现成的非常完整的例子。
关于第二个问题,只需在InitInstance中插入一句话即可:
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
//下面一行为我加入的一句话:
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;