CComPtr pass by reference
- by Mahesh
I have a situation where I need to pass a CComPtr<IXmlReader> to a function by reference. Does the called parameter takes the ownership from the callee parameter (or) the reference count is increased?
void foo( CComPtr<IXmlReader> & pReader )
{
// There is no reassignment of the CComPtr.
// Just call the IXmlReader methods.
}
CComPtr<IXmlReader> pReader;
foo( pReader );
// Is pReader still valid after the function return ?
Thanks.