TRACE1("%s\n", GetCommandLineW());//获取命令行参数
OutputDebugStringW(GetCommandLineW());
int argNum;
PWSTR *ppArgv = CommandLineToArgvW(GetCommandLineW(),&argNum);//将参数转成数组
for (int i=0;i<argNum;i++)
{
OutputDebugStringW(ppArgv[i]);
}
HeapFree(GetProcessHeap(),0,ppArgv);//ppArgv为系统内部分配的内存可以不释放,但在进程结束时系统释放
转载于:https://www.cnblogs.com/nuaa/p/3189150.html