locked
Macro for Metro Application

    Question

  • Hi i am porting my existing code to metro . I compiled my code with WINAPI_AMILY=2 and it compiled without any errors .However ,when  i compiled with UNICODE and _UNICODE macros compiler showed lots of errors (mostly related to string conversion in my case) . I want to know if UNICODE and _UNICODE are compulsory macros for a metro app.
    Thursday, June 21, 2012 11:04 AM

Answers

  • They are not compulsory, but depending on what functions you call they may make things easier for you. Any Win32 API which accepts strings is available to Metro style apps only in its Unicode version. If you use MBCS strings you will need to convert them before passing them to these functions.

    Since you are getting errors already I expect you are calling such functions and it will be easier to #define UNICODE and then fix your string constants than to manually convert before calling Win32 API.

    --Rob

    • Marked as answer by Mukesh Gupta Friday, June 22, 2012 8:55 AM
    Friday, June 22, 2012 2:49 AM
    Owner