以下错误是@GetFullPathName() 函数
1 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR"
2 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPWSTR"
当我尝试运行我的程序时,我不断收到上述错误。变量是适当的类型,但它一直说不是吗?关于为什么会这样的任何想法?我认为没有必要对它们进行类型转换。
#include "stdafx.h"
using namespace std;
int main(int argc, _TCHAR* argv[])
{
/* Get path of DLL we're loading */
string name;
cin >> name;
const char* DLL_NAME = name.c_str();
HWND handle = FindWindow(0, L"Calculator");
if(handle == NULL){
cout << "Couldn't find process window!" << endl;
}else{
cout << "Process window found, continuing..." << endl;
DWORD id;
GetWindowThreadProcessId(handle, &id);
char DLL_LOCATION[MAX_PATH] = {0};
GetFullPathName(DLL_NAME, MAX_PATH, DLL_LOCATION, NULL);
}
return 0;
}