135-1821-9792

获取命令行参数

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://kswsj.com/article/ihjjig.html

其他资讯



Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号