我有以下代码C++系统功能挂起应用
void reportResults()
{
wstring env(_wgetenv(L"ProgramFiles"));
env += L"\Internet Explorer\iexplore.exe";
wstringstream url;
url << "\"\"" << env.c_str() << "\" http://yahoo.com \"";
wchar_t arg[BUFSIZE];
url.get(arg, BUFSIZE);
wcout << arg << endl;
_wsystem(arg);
}
其中arg是: “” C:\ Program Files文件\的Internet Explorer \ IEXPLORE.EXE “http://yahoo.com”
程序按预期运行,启动IE并导航到Yahoo,但调用函数(reportResults)从不退出。如何让程序退出,使浏览器保持活动状态? 谢谢。
似乎就像唯一的答案,实际上解释了什么是错的,而不是只给予直接的解决方案。 +1 – 2009-06-12 16:29:06