CComQIPtr Class
Visual Studio 2012
A smart pointer class for managing COM interface pointers.
template< class T, const IID* piid = &__uuidof(T) > class CComQIPtr: public CComPtr<T>
ATL uses CComQIPtr and CComPtr to manage COM interface pointers, both of which derive from CComPtrBase. Both classes perform automatic reference counting through calls to AddRef and Release. Overloaded operators handle pointer operations.