when I tried to compile my project, I got some errors that I cannot solve. In any case, this is one of the codes:
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); }
And the error:
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
Thanks for the help. Regards, Messer
source share