Jump to content
  • Advertisement

Archived

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

stu_pb

ATL Object and BSTR out parameter...

This topic is 5482 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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!