
Originally Posted by
stampede
Show the line of code that generates the error. If all you need is to call WinApi function that expects TCHAR *, you can use the L"" macro:
HRESULT someWinApiMethod( TCHAR * string );
//...
someWinApiMethod(L"a wide unicode string constant");
HRESULT someWinApiMethod( TCHAR * string );
//...
someWinApiMethod(L"a wide unicode string constant");
To copy to clipboard, switch view to plain text mode
As for QStrings, you can use
toWCharArray and
fromWCharArray conversion methods.
That's a good suggestion. I convert some strings with this method and errors reduce. There are some other errors that I don't know how to solve:
for example
int cmp = _tcsnicmp(KeyNames[Middle].keyName, KeyString, _tcslen(KeyString));
error: cannot convert 'TCHAR*' to 'char*' for argument '1' to 'char* strncpy(char*, const char*, size_t)'
while (*p && *p != _TXCHAR('}'))
p++;
error: '_TXCHAR' was not declared in this scope
_tcscpy(titleclass, WindowTitle);
error: cannot convert 'TCHAR*' to 'const char*' for argument '1' to 'char* strstr(const char*, const char*)'
int cmp = _tcsnicmp(KeyNames[Middle].keyName, KeyString, _tcslen(KeyString));
error: cannot convert 'TCHAR*' to 'char*' for argument '1' to 'char* strncpy(char*, const char*, size_t)'
while (*p && *p != _TXCHAR('}'))
p++;
error: '_TXCHAR' was not declared in this scope
_tcscpy(titleclass, WindowTitle);
error: cannot convert 'TCHAR*' to 'const char*' for argument '1' to 'char* strstr(const char*, const char*)'
To copy to clipboard, switch view to plain text mode
I suggest an expert, if has time, see the attached code in previous post and debug it. I'm sure it is a very useful program which can help many.
Bookmarks