Click to See Complete Forum and Search --> : CComPtr


George2
April 3rd, 2008, 10:46 AM
Hello everyone,


In the book ATL Internals, it is mentioned, the properties of CComPtr is,

--------------------
Release the encapsulated interface pointer when the class destructor executes;
Automatically releases its interface pointer during exception handling, ...
--------------------

They both means invoking the Relase method (inherited from IUnknown) of the interface?


thanks in advance,
George

Arjay
April 3rd, 2008, 11:30 AM
Yes.

Igor Vartanov
April 3rd, 2008, 04:56 PM
...\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include>grep -n ~CComPtr *.h
atlcomcli.h:125: ~CComPtrBase() throw()

~CComPtrBase() throw()
{
if (p)
p->Release();
}

George2
April 4th, 2008, 03:13 AM
Thanks Arjay and Igor,


Question answered.

...\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include>grep -n ~CComPtr *.h
atlcomcli.h:125: ~CComPtrBase() throw()

~CComPtrBase() throw()
{
if (p)
p->Release();
}


regards,
George