ANSI console processes written in C can use the argc and argv arguments of the main function to access the command-line arguments.ANSI GUI applications can use the lpCmdLine parameter of the WinMain function to access the command-line string, excluding the program name.

解决方案 »

  1.   

    命令行参数
    类似于 main参数中的argv
      

  2.   

    LPCTSTR lpComm=::GetCommandLine(); char szModule[1024];
    ::GetModuleFileName(NULL, szModule, MAX_PATH);
    int nPos=strcspn(lpComm, szModule);
    if  (nPos<0)
    return FALSE;请问上面的代码有什么作用?
      

  3.   

    参数分解去掉路径,获得真正的参数GetCommandLine获得的还包括路径
      

  4.   

    问题是我在MFC中测试发现两个函数得到的是一样的,
    都是程序的完整路径