How to concatenate BSTR strings in ATL
Posted on 2003-03-16
I have written a VC++ DLL using ATL and I want to use a Visual Basic client to pass 2 properties, FirstName and Surname. Then invoke a method in my VC++ COM class which will just concatenate the 2 strings together and return in a 3rd property called FullName, with a space in the middle, ie.
FirstName = "Fred"
Surname = "Smith"
FullName = "Fred Smith"
I have created 2 properties, FirstName and Surname in my class, with types BSTR. But even after converting the unicode to an ansi using WideCharToMultiByte, I still haven't figured out how to add the 2 together and return FullName.
Any clues please...