Can we have our application as _UNICODE supported as well _MBCS supported?
-
Hi, Can we have our application as _UNICODE supported as well _MBCS supported? I am in middle of a robust project, where we are using some third party sources. if i set my project to _UNICODE supported then it forces all the places where i am handling strings are to be wchar, TCHAR etc., can i make the same in some files, since it forces to make changes in third party sources. To make UNICODE Supported i made changes like "In Project settings in preprocessor definitions i just added _UNICODE. Also set startup with wWinMainCRTStartup. Qns: Can i support both of them ? if so How ? Thanks in advance. :rose:
Thanks a lot
-
Hi, Can we have our application as _UNICODE supported as well _MBCS supported? I am in middle of a robust project, where we are using some third party sources. if i set my project to _UNICODE supported then it forces all the places where i am handling strings are to be wchar, TCHAR etc., can i make the same in some files, since it forces to make changes in third party sources. To make UNICODE Supported i made changes like "In Project settings in preprocessor definitions i just added _UNICODE. Also set startup with wWinMainCRTStartup. Qns: Can i support both of them ? if so How ? Thanks in advance. :rose:
Thanks a lot
You are free to mix types all you want. It's up to you to keep track of the settings and make sure you're using the right character types in the right places, and converting where necessary. I personally would go all unicode and use other character types only where required, but that's just me. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You are free to mix types all you want. It's up to you to keep track of the settings and make sure you're using the right character types in the right places, and converting where necessary. I personally would go all unicode and use other character types only where required, but that's just me. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You are free to mix types all you want. It's up to you to keep track of the settings and make sure you're using the right character types in the right places, and converting where necessary. I personally would go all unicode and use other character types only where required, but that's just me. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
No it is not possible if you set your project _UNICODE in project settings, it will override _MBCS. But i am here in position of converting a large project into UNICODE SUPPORTED. Can i build that third party tool into a DLL and link them with my project ? Even though that also be defined _UNICODE. Any Idea ? Get me out of this difficulty!. :(( Thanks :rose:
Thanks a lot
-
No it is not possible if you set your project _UNICODE in project settings, it will override _MBCS. But i am here in position of converting a large project into UNICODE SUPPORTED. Can i build that third party tool into a DLL and link them with my project ? Even though that also be defined _UNICODE. Any Idea ? Get me out of this difficulty!. :(( Thanks :rose:
Thanks a lot
ganesa moorthy wrote:
if you set your project _UNICODE in project settings, it will override _MBCS
Of course, but you need to understand how that affects your compilation. Those are simply macros used with conditional compilation. The macros effect the default char types in API function arguments and system structures. They also affect the type of the tchar.h generic types like TCHAR. You are still free to use specific types where necessary. For the affected Windows APIs, you can call the specific APIs using the W and A suffixes where required. Same with Windows SDK structures. In places where you need a specific char type, do NOT use the generic TCHAR - use the right type. If you have third party code that requires a different character type then you need to deal with that by converting your strings/char arrays to the correct type where necessary.
ganesa moorthy wrote:
No it is not possible
Not true :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
ganesa moorthy wrote:
if you set your project _UNICODE in project settings, it will override _MBCS
Of course, but you need to understand how that affects your compilation. Those are simply macros used with conditional compilation. The macros effect the default char types in API function arguments and system structures. They also affect the type of the tchar.h generic types like TCHAR. You are still free to use specific types where necessary. For the affected Windows APIs, you can call the specific APIs using the W and A suffixes where required. Same with Windows SDK structures. In places where you need a specific char type, do NOT use the generic TCHAR - use the right type. If you have third party code that requires a different character type then you need to deal with that by converting your strings/char arrays to the correct type where necessary.
ganesa moorthy wrote:
No it is not possible
Not true :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
It is really an useful hint!, i hope i can use it n my project. Thanks :rose:
Thanks a lot