当我尝试编译我的项目时,我遇到了一些我无法解决的错误。无论如何,这是代码之一:
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);
}
错误是:
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
感谢您的帮助.. 问候,梅塞尔