What does LPCWSTR stand for and how should it be handled with?

后端 未结 3 1403
醉话见心
醉话见心 2020-11-29 18:47

First of all, what is it exactly? I guess it is a pointer (LPC means long pointer constant), but what does \"W\" mean? Is it a specific pointer to a string or a pointer to a

3条回答
  •  既然无缘
    2020-11-29 19:03

    LPCWSTR stands for "Long Pointer to Constant Wide String". The W stands for Wide and means that the string is stored in a 2 byte character vs. the normal char. Common for any C/C++ code that has to deal with non-ASCII only strings.=

    To get a normal C literal string to assign to a LPCWSTR, you need to prefix it with L

    LPCWSTR a = L"TestWindow";
    

提交回复
热议问题