Thursday, 12 September 2013

Out parameters deallocation in an out of process COM server

Out parameters deallocation in an out of process COM server

I have an out of process COM server which has the following method:
STDMETHODIMP CMyCom::process(/[out]/BSTR* pResponse);
In this method I allocate memory for the pResponse attribute as follows:
*pResponse = ::SysAllocString("Some string");
My question is, when the method returns, who takes the responsibility for
freeing the memory allocated for this BSTR? Is it the COM subsystem?

No comments:

Post a Comment