需要在App类的InitInstance()中添加下面的第三行内容即可:

    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing; // 禁止自动创建空白子窗体

    // 调度在命令行中指定的命令。如果
    // 用 /RegServer、/Register、/Unregserver 或 /Unregister 启动应用程序,则返回 FALSE。
    if (!ProcessShellCommand(cmdInfo))
        return FALSE;

参考:http://blog.csdn.net/missile1226/article/details/8375065

posted on 2015-02-27 12:13  云海空间软件  阅读(462)  评论(0编辑  收藏  举报