Need a small advice regarding strings
-
I have to use legacy C code, where functions understand nothing else but char* So the question is, what is the best way to convert the char* to unicode strings, to be displayed in a message box, or set in an CEdit control for example.
-
I have to use legacy C code, where functions understand nothing else but char* So the question is, what is the best way to convert the char* to unicode strings, to be displayed in a message box, or set in an CEdit control for example.
no_reg_name wrote: what is the best way to convert the char* to unicode strings
int MultiByteToWideChar( UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar );
--- "Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
-
I have to use legacy C code, where functions understand nothing else but char* So the question is, what is the best way to convert the char* to unicode strings, to be displayed in a message box, or set in an CEdit control for example.
You can use the
A2W
macro but remember to stateUSES_CONVERSION
within the function that uses the macro.USES_CONVERSION;
...
wide = A2W(ascii);
...Hope that helps Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fuity and sweet.
I'm jelly, what am I? - David Williams (Little Britain)