CComPtr pass by reference

Posted by Mahesh on Stack Overflow See other posts from Stack Overflow or by Mahesh
Published on 2012-04-11T11:21:42Z Indexed on 2012/04/11 11:29 UTC
Read the original article Hit count: 656

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about c++

Related posts about atl