Increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.
ULONG AddRef( );
This method has no parameters.
The method returns the new reference count. This value is intended to be used only for test purposes.
Objects use a reference counting mechanism to ensure that the lifetime of the object includes the lifetime of references to it. You use AddRef to stabilize a copy of an interface pointer. It can also be called when the life of a cloned pointer must extend beyond the lifetime of the original pointer. The cloned pointer must be released by calling IUnknown::Release.
The internal reference counter that AddRef maintains should be a 32-bit unsigned integer.IUnknown::Release before copying the out-value on top of it.
|Windows version||Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]|
|Header||unknwn.h (include Unknwn.h)|