我是新手Visual Studio
,需要编译应用程序,但出现错误: error C2440: '=': cannot convert from 'const char *' to 'LPCWSTR'
在线:
std::string open_file_dialog(
std::string title,
std::string filter)
{
char filename[MAX_PATH];
OPENFILENAME ofn;
ZeroMemory(&filename, sizeof(filename));
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL;
ofn.lpstrFilter = filter.c_str();
ofn.lpstrFile = filename;
我相信这可能与我的项目设置有关,因为我正在查看的源代码应该按原样编译。但是,我不能 100% 确定。有谁可以帮我离开这里吗?