In addition to super_ttd's reply...
If you must use fopen(), then you should probably use a CStringA.
CString has a generic internal character type, depending on whether
UNICODE or _UNICODE is defined.
If you want to use the generic text CString, then it will pair nicely
with the generic text version of fopen(), which is _tfopen().
Gut Mikh Tappe wrote:
char buffer[MAX_PATH];
GetModuleFileName(NULL,(LPWCH)buffer,MAX_PATH);
Bad cast!! GetModuleFileName takes a LPTSTR as its second parameter.
Your buffer, therefore, should be a TCHAR type, not char.
Mind your types.....if you need a cast to get something to compile, look at WHY.
Mark