ATL Object and BSTR out parameter...
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...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement