The comprehensive guide to BSTRs from Microsoft: http://msdn.microsoft.com/library/te...n_article3.htm

It should answer all your questions - and it certainly helped me avoid lots
of mistakes in COM!!

Neil Schulman
PhoneOnline.com

"Brian Leung" <bleung@zoo.cam.ac.uk> wrote:
>
>Hi,
>
>I'd like to pass BSTRs back and forth between C++ and VB.
>Reading the documentation on _bstr_t, it sounded like I could
>attach the _bstr_t to an existing BSTR (created in VB) and modify
>the BSTR. There is an option such that _bstr_t does not create
>a new BSTR. That works, but why doesn't it change the BSTR that VB
>sees? When I pass the string back, I get the original string.
>
>Also, If I create a BSTR within C++ and call a function within
>VB, passing the BSTR to the function, and if I modify the BSTR
>will this cause problems? Are there any solutions?
>
>Thanks,
>
>Brian