【发布时间】:2015-05-09 00:36:48
【问题描述】:
我正在开发一个应该启动 Internet Explorer 并在 Windows 7 上显示本地 html 文件的 c++ 程序。我正在尝试使用 ShellExecute,但它不起作用。我四处搜索,但找不到有效的答案。这是代码:
ShellExecute(NULL, "open", "start iexplore %userprofile%\\Desktop\\html_files\\file.hml", NULL, NULL, SW_SHOWDEFAULT);
我将命令复制到 system() 调用中只是为了查看它是否可以工作,并且确实可以。这是我尝试的 system() 调用:
system("start iexplore %userprofile%\\Desktop\\html_files\\file.html");
由于系统调用有效,它显然是 ShellExecute 的问题。基本上,Internet Explorer 不会出现。不过,一切都正确编译。有什么想法吗?
【问题讨论】:
标签: windows windows-7 shellexecute