From RAD Studio API Documentation
Jump to: navigation, search


virtual ULONG STDMETHODCALLTYPE AddRef( void) = 0;


Type Visibility Source Unit Parent
function public unknwn.h System IUnknown


Increments the reference count for this interface.

For most implementations, AddRef increments the reference count for the interface and returns the new reference count. When the caller is through with the interface, the user must call the Release method, which decrements the reference count. When the reference count drops to zero, the object is automatically freed.


  • Implementation objects can implement AddRef and Release so that they do not perform any reference counting. For such objects, the reference count never drops to zero and the object is not automatically freed. In these cases, it is the application's responsibility to free the object.
  • Call this method for every new copy of this interface pointer that you create.

See Also