VOID StartMain() { LPWSTR *szArglist; int nArgs; int i; szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs); if (NULL == szArglist) { wprintf(L"CommandLineToArgvW failed\n"); return ; } else { for (i = 0; i < nArgs; i++) { CString strTemp; strTemp.Format(_T("%s"), szArglist[1]); if (strTemp == _T("1")) StartPrintServer(); if (strTemp == _T("2")) StarUserManage(); } //释放CommandLineToArgvW参数占用的内存. LocalFree(szArglist); return; } }
获取命令行参数
猜你喜欢
转载自blog.51cto.com/9233403/2104328
今日推荐
周排行