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;
}
}
原文地址:http://blog.51cto.com/9233403/2104328
时间: 2024-11-07 04:59:33