the framework created by AppWizard does have the ability.
You just need to parse the command line by using ParseCommandLine function

解决方案 »

  1.   

    简单一点,建个win32 console application
      

  2.   

    see msdn CXXApp

    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
      

  3.   

    CWinApp的m_lpCmdLine成员变量就是你要的参数;如:C>: YourExe -p -sm_lpCmdLine就是"-p -s"
      

  4.   

    1.派生自己的类 CCommandLineInfo
    2.
    BOOL CMarkupApp::InitInstance()
    {
    ... // Parse command line for standard shell commands, DDE, file open
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line
    if (!ProcessShellCommand(cmdInfo))
    return FALSE; ... return TRUE;
    }
      

  5.   

    hover(翔):是呀!你是那位,以前我向你问问题的前辈吧?我的问题已基本解决:有空请观裳http://www.csdn.net/cnshare/soft/10/10802.shtm
      

  6.   

    小弟刚接触VC网络编程,有一个问题想请教:在VC中如何获取本机的IP地址?为什么我用GetSockName()得到的是"0.0.0.0"?谢谢
      

  7.   

    The GetAddressByName function queries a name space, or a set of default name spaces, in order to obtain network address information for a specified network service. This process is known as service name resolution. A network service can also use the function to obtain local address information that it can use with the bind function.
      

  8.   

    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    可以处理常规的参数很方便,如打开文件,打印等...
    但如果要使用自定义的参数就不行了。
    如果你使用CWinApp作为你的应用程序基类可以在CWinApp::m_lpCmdLine中找到命令行字符串,而后随便你怎么解析。
      

  9.   

    如果我有多个不同的参数的组合,该怎么去识别它里面的每一个参数?例如:My.exe -a -b -c...,程序怎么自动识它有几个参数?