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)和这些参数。应该可以