1

There are some questions talked about conversion between std::wstring and CComBSTR, like this one, but what' the advantage of each one over the other if both are available in a project?

Community
  • 1
  • 1
Thomson
  • 20,586
  • 28
  • 90
  • 134

1 Answers1

3

std::wstring has more methods for actual string handling, whereas CComBSTR is meant specifically for holding a BSTR string. BSTRs are used mostly by COM methods and have a different memory layout. Generally you should use std::wstring or CString unless you actually need the memory layout of BSTRs.

user1610015
  • 6,561
  • 2
  • 15
  • 18