__arg 和 __argv就可以了。

解决方案 »

  1.   

    WinMain 中 就有LPSTR lpCmdLine参数
      

  2.   

    Windows程序:程序名 参数 => Winmain(...参数)
    dos程序:程序名 参数 => 参数分析代码 => main(argc,char ** argv);
    你:程序名 参数 => Winmain(...参数) => 参数分析代码
      

  3.   

    lpCmdLine
    :
    ExampleBOOL CMyApp::InitInstance()
    {
       // ...
      
       if (m_lpCmdLine[0] == _T('\0'))
       {
          // Create a new (empty) document.
          OnFileNew();
       }
       else
       {
          // Open a file passed as the first command line parameter.
          OpenDocumentFile(m_lpCmdLine);
       }
      
       // ...
    }