Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AtlComPtrAssign

 

Assigns an interface pointer to another interface pointer of the same type.


      ATLINLINE ATLAPI_(IUnknown*) AtlComPtrAssign(
   IUnknown** pp,
   IUnknown* lp
);

pp

Address of an IUnknown pointer to which to assign another pointer.

lp

An IUnknown pointer of the same type as the one in pp. This is assigned to the pointer in pp.

Returns NULL on error; otherwise returns lp.

This function copies an interface pointer using COM reference counting rules. It calls Release on the interface pointed to by pp and then assigns lp to it after incrementing the reference count.

This smart pointer helper function is used by CComPtr Class and CComQIPtr Class.

Requirements

Header: atlcomcli.h

Show: