基于对话框的应用程序如何获取入口参数?谢谢. 基于对话框的应用程序如何获取入口参数?例如 p1.exe -abc -cd 这时在p1中如何知道用户输入了abc 及cd 呢? 请指点?最好有个例子. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用GetCommandLine()就可以了。 BOOL CHddAgingApp::InitInstance(){..........CString cmd; cmd = m_lpCmdLine; //If no parameter, open the main window if(!cmd.CompareNoCase("")) { ........ } //Define the command content int dwCount; LPWSTR *lpwArgv = NULL; lpwArgv = CommandLineToArgvW(GetCommandLineW(), &dwCount); //Get help information if(dwCount == 2) { if((!_wcsnicmp(lpwArgv[1], L"/H", 2) || !_wcsnicmp(lpwArgv[1], L"/?", 2)))....} 得到第一个参数__argv[ 0 ],第二个__argv[ 1 ],第三个__argv[ 2 ]参数的总个数是__argc OpenGL 剖切求助 轮廓提取问题 怎样用VC实现动态显示局域网内活动主机IP、MAC地址以及主机名 怎样在LISTCTRL里换行显示? 受不了这该死的delete[] 用enum型的数据类型作为函数的返回值类型的时候,为什么必须把enum的定义在类的定义之外? 如何在WIN32程序里调用一个指定的console程序? Agent 为何你不出来呀,我着急了! 为什么我的程序要过一段时间才能显示主窗口? 生成一个OCX控件遇到控件中edit无法显示问题 如何使用WebBrowser获得一个网页的内容?
{
..........CString cmd;
cmd = m_lpCmdLine;
//If no parameter, open the main window
if(!cmd.CompareNoCase(""))
{
........
} //Define the command content
int dwCount;
LPWSTR *lpwArgv = NULL;
lpwArgv = CommandLineToArgvW(GetCommandLineW(), &dwCount); //Get help information
if(dwCount == 2)
{
if((!_wcsnicmp(lpwArgv[1], L"/H", 2) || !_wcsnicmp(lpwArgv[1], L"/?", 2)))
....
}