Get command line arguments

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 ();

		}
		//Release the memory occupied by the CommandLineToArgvW parameter.
		LocalFree(szArglist);
		return;
	}
}


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324523520&siteId=291194637