PCWSTR vs LPWSTR

后端 未结 2 1525
予麋鹿
予麋鹿 2021-01-12 23:54

It is my understanding (and please correct me if I\'m wrong) that the only difference between them is whether the string might be modified by the called function. (PCWSTR ,

2条回答
  •  佛祖请我去吃肉
    2021-01-13 00:15

    A function taking a PCWSTR parameter can't use that parameter to modify the characters of the string, unlike a function that takes a LPWSTR parameter. Each character of the string is stored as WCHAR.

    UnmanagedType.LPWStr is the right marshalling type for such a string.

提交回复
热议问题