visual c++ - Modifying C++ DLL to support unicode - common pitfalls to avoid? -
I have a Windows DLL which currently only supports ASCII and I want to work with Unicode strings Need to update. This DLL currently uses four * string in many places, making many ASCII windows API calls (such as GetWindowTextA, RegQueryValueExA, CreateFileA, etc.).
I defined TCHAR instead of four or CRAR, so I defined in Unicode / ASCI macros VC ++. For four * I will use LPTRS. And I think things like sprintf_s will be converted to _stprintf_s
I have never dealt with Unicode ever before, so I am thinking that there is such a general disadvantage when I should look outside to do this. Should there be enough to replace the names of the type and method with proper macros, or are there other complications for it?
First read this article by Joel Spolsky:
Then on Stacks Overflow Run through these links:
Generally, you any code which one letter = one byte (memory / buffer allocation, etc.) Believes. But the above links will give you a very good location of the details.
Enjoy,
Robert C. Cartano
Comments
Post a Comment