我将我的代码从 Visual Studio 移动到 Visual Studio Code,现在我遇到了以前没有的错误。我该如何解决?
我期待它像以前一样工作,但没有,因为我移动了文本编辑器。
这是我的代码:
while (::Process32Next(snapShot, &entry))
{
if (!processName.compare(entry.szExeFile))
{
processId = entry.th32ProcessID;
processHandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
break;
}
}
这是完整的错误:
no instance of overloaded function "std::basic_string_view<_Elem, _Traits>::compare [with _Elem=char, _Traits=std::char_traits<char>]" matches the argument listC/C++(304)
memory.h(27, 21): argument types are: (WCHAR [260])
memory.h(27, 21): object type is: const std::string_view