Which is better code for converting BSTR parameters to ANSI in C/C++?

后端 未结 4 787
谎友^
谎友^ 2021-01-14 18:28

So far I\'ve discovered I can convert incoming BSTRs to ANSI in two (of many?) ways, and I\'m curious to know whether one is \"better\" than the other with respect to speed

4条回答
  •  抹茶落季
    2021-01-14 18:59

    It's been a long time since i've done anything with COM or BSTRs but my suggestion is to stop treating BSTR's as something special. Treat them like a pointer to a wide character zero terminated string... if you do it might be easier to convert them to ANSI. check Eric's Complete Guide to BSTR Semantics...

提交回复
热议问题