Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/127.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t使用c+;在浏览器中打开html文件+;_Html_C++ - Fatal编程技术网

Can';t使用c+;在浏览器中打开html文件+;

Can';t使用c+;在浏览器中打开html文件+;,html,c++,Html,C++,我有以下代码: #include <windows.h> void statistics(){ //processing code LPCTSTR helpFile = "report.html"; ShellExecute(NULL, "open", helpFile, NULL, NULL, SW_SHOWNORMAL); system("PAUSE"); } #包括 void统计(){ //处理代码 LPCTSTR helpFile=“report.

我有以下代码:

#include <windows.h>
void statistics(){
 //processing code
    LPCTSTR helpFile = "report.html";
    ShellExecute(NULL, "open", helpFile, NULL, NULL, SW_SHOWNORMAL);
    system("PAUSE");
}
#包括
void统计(){
//处理代码
LPCTSTR helpFile=“report.html”;
ShellExecute(NULL,“打开”,帮助文件,NULL,NULL,SW_SHOWNORMAL);
系统(“暂停”);
}
如果我把这些代码行放在“main”函数中,它会工作,但在这里它会写一个错误:“error:类型为“const char*”的值不能用于初始化类型为“LPCTSTR”的实体。”。
你知道为什么吗?

使用
ShellExecuteA
(用于
char
s)和这些参数。应该可以