Your project is most likely using the Unicode character set under the General Project Properties.
You can change this to ASCII to fix this, however I would recommend changing your code instead
int CFileRead::ReadFromPos(LONG lBeginFrom, DWORD lLen, LPTSTR lpszBuffer) {
hFile = CreateFile(lpszFileName, GENERIC_READ, FILE_SHARE_WRITE + FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_ARCHIVE, NULL);
bool CRegEnum::OpenKey(HKEY RegKey, LPTSTR SubKey) {
if (hKey != NULL) RegCloseKey(hKey);
if ( RegOpenKeyEx(RegKey, SubKey,0 , KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS ) return false;
return true;
}
Then you will need to add the
_T()
or
TEXT()
macros around all your strings to make them Unicode:
OpenKey(HKEY_LOCAL_MACHINE, TEXT("Software"));
Functions like
strlen
,
strcpy
and
printf
will now become
_tcslen
,
_tcscpy
and
_tprintf
respectively.