Check whether a Visual C++ 6.0 project did support unicode or not?

旧城冷巷雨未停 提交于 2019-12-13 08:47:57

问题


I need to know if a Visual C++ 6.0 project supports Unicode or not. How can I check that?


回答1:


If the project is compiled with Unicode support, then the preprocessor directive UNICODE (or _UNICODE) will be defined. Testing to see if this is defined will give you your answer:

#if defined(UNICODE) || defined(_UNICODE)
    // The project is compiled for Unicode
#else
    // The project is NOT compiled for Unicode
#endif

You can also check this from within your project's settings.

  1. From the "Project" menu, click "Settings".
  2. Select the "C/C++" tab.
  3. In the "Preprocessor definitions" section, check for the presence of UNICODE and _UNICODE.

If you have a project that is not currently targeting Unicode, but you want to see if it can, then the best thing to do would be to define these preprocessor directives, and then try compiling your project. If it succeeds, then you're set. If it fails, go through and correct the errors emitted by the compiler.




回答2:


#ifdef UNICODE
#   error Success!
#endif


来源:https://stackoverflow.com/questions/10494859/check-whether-a-visual-c-6-0-project-did-support-unicode-or-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!