Reputation: 83
I am trying to communicate ATL COM dll with PHP. I am able to call the COM dll function and pass and retrieve the int/long values to and from PHP. But not able to access and print BSTR value in PHP.
Please guide me, sample example is more helpful.
.
Upvotes: 0
Views: 109
Reputation: 83
Finally I got the solution. To return string to PHP following code worked in my COM code.
STDMETHODIMP CMyClass::MyFun(BSTR in, VARIANT* o)
{
// TODO: Add your implementation code here
VariantClear(o);
o->vt = VT_BSTR;
o->bstrVal = ::SysAllocString(in);
return S_OK;
}
Upvotes: 1