TCHAR szLocalPath[MAX_PATH];
TCHAR szTempPath[MAX_PATH];
TCHAR szTempName[50];
GetModuleFileName(NULL,szLocalPath,sizeof(szLocalPath));
GetTempPath(MAX_PATH,szTempPath);
GetFileTitle(szLocalPath,szTempName,50);
wcscat(szTempPath,szTempName);//这里报错,就涉及到这些代码
error C2664: 'wcscat' : cannot convert parameter 1 from 'char [260]' to 'unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
做个强制类型转换吧:
wcscat((wchar_t *)&szTempPath[0], szTempName);
做个强制类型转换吧:
wcscat((wchar_t *)&szTempPath[0], szTempName);