Classes.TComponent. AddRef

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From Classes.pas

	function _AddRef(): Integer;


Unit: Classes

Type: method

Visibility: protected

Member Of: TComponent

C++ Information

From Classes.hpp

	int __fastcall _AddRef(void);


Unit: Classes

Type: method

Visibility: protected

Member Of: TComponent

Description

Called when an application uses a component interface.


__AddRef is a basic implementation of the IInterface method, _AddRef.

Note:  If the component is a wrapper for a COM object, __AddRef calls the _AddRef method of that COM object, and returns the resulting reference count.

In all other cases, __AddRef simply returns –1 and takes no action. This allows the component to implement interfaces where reference counting is not required. More sophisticated components should override __AddRef to implement reference counting.

See Also

Personal tools
Translations
Newest Version