vc 2005 compile error
-
I'm getting errors like this error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char *' to 'LPWCH' char szFilespec [_MAX_PATH]; // filespec // Get name of .exe file //sans name ::GetModuleFileName (0, szFilespec, _MAX_PATH); and error C2664: 'atoi' : cannot convert parameter 1 from 'ATL::CStringT' to 'const char *' time_t CLogRead::GetTimeFromStrings(char *chDate,char *chTime){ struct tm t; CString tmpStr; CString strMonth; tmpStr = chDate; tmpStr +=" "; tmpStr += chTime; t.tm_year = atoi(tmpStr.Mid(7,4)) - 1900; i seem to recall this is something about Unicode. How do I change my project tio get rid of these compile errors? I'm not familiar with the IDE so if you could direct me how to,I'd appreciate it. thanks, sb
-
I'm getting errors like this error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char *' to 'LPWCH' char szFilespec [_MAX_PATH]; // filespec // Get name of .exe file //sans name ::GetModuleFileName (0, szFilespec, _MAX_PATH); and error C2664: 'atoi' : cannot convert parameter 1 from 'ATL::CStringT' to 'const char *' time_t CLogRead::GetTimeFromStrings(char *chDate,char *chTime){ struct tm t; CString tmpStr; CString strMonth; tmpStr = chDate; tmpStr +=" "; tmpStr += chTime; t.tm_year = atoi(tmpStr.Mid(7,4)) - 1900; i seem to recall this is something about Unicode. How do I change my project tio get rid of these compile errors? I'm not familiar with the IDE so if you could direct me how to,I'd appreciate it. thanks, sb
Open the project properties, go to "C/C++" -> "Preprocessor" and click on the "Preprocessor Definitions" line. A button will appear on the right of this line, click on it this will display a dialog. On this dialog uncheck the "Inherit from parent or project defaults".
Cédric Moonen Software developer
Charting control [v1.2] -
I'm getting errors like this error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char *' to 'LPWCH' char szFilespec [_MAX_PATH]; // filespec // Get name of .exe file //sans name ::GetModuleFileName (0, szFilespec, _MAX_PATH); and error C2664: 'atoi' : cannot convert parameter 1 from 'ATL::CStringT' to 'const char *' time_t CLogRead::GetTimeFromStrings(char *chDate,char *chTime){ struct tm t; CString tmpStr; CString strMonth; tmpStr = chDate; tmpStr +=" "; tmpStr += chTime; t.tm_year = atoi(tmpStr.Mid(7,4)) - 1900; i seem to recall this is something about Unicode. How do I change my project tio get rid of these compile errors? I'm not familiar with the IDE so if you could direct me how to,I'd appreciate it. thanks, sb
ns wrote:
char szFilespec [_MAX_PATH];
change this line to using
TCHAR
instead of char
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Open the project properties, go to "C/C++" -> "Preprocessor" and click on the "Preprocessor Definitions" line. A button will appear on the right of this line, click on it this will display a dialog. On this dialog uncheck the "Inherit from parent or project defaults".
Cédric Moonen Software developer
Charting control [v1.2]