当我试图编译我的项目时,我遇到了一些我无法解决的错误..无论如何这是其中一个代码:
public:
void Init(HMODULE hModule, string Filename)
{
char szLoc[ MAX_PATH ];
GetModuleFileName(hModule, szLoc, sizeof( szLoc ) );
char* dwLetterAddress = strrchr( szLoc, '\\' );
*( dwLetterAddress + 1 ) = 0;
strcat( szLoc, Filename.c_str() );
__OutStream.open( szLoc, ios::app);
}
Run Code Online (Sandbox Code Playgroud)
错误是:
error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char [260]' to 'LPWCH'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助..问候,梅塞尔