Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


ATL Object and BSTR out parameter...

This topic is 5388 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The following ATL Object code block works when called from a VB Application that simply displays a message box with the returned data: STDMETHODIMP CSomeClass::get_SomeData(BSTR *pVal) { CComBSTR tmp; tmp += "h"; tmp += "i"; *pVal = tmp.Detach(); } The following code block does not work when called from the same VB application: STDMETHODIMP CSomeClass::get_SomeData(BSTR *pVal) { char Data[] = {"hXXXXi"}; CComBSTR tmp; tmp += Data[0]; tmp += Data[5]; *pVal = tmp.Detach(); } Can anyone help me out with how I can convert the char''s into the BSTR return val "hi". Thanks for the help! I should probably be working now...

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!