System.Win.ComObj.TAutoObject.CreateFromFactory

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

constructor CreateFromFactory(Factory: TComObjectFactory;
const Controller: IUnknown);

Properties

Type Visibility Source Unit Parent
constructor public System.Win.ComObj.pas System.Win.ComObj TAutoObject

Description

Instantiates a COM object and initializes its values.

System.Win.ComObj.TAutoObject.CreateFromFactory inherits from System.Win.ComObj.TComObject.CreateFromFactory. All content below this line refers to System.Win.ComObj.TComObject.CreateFromFactory.

Instantiates a COM object and initializes its values.

Call Create to instantiate a COM object that is not part of an aggregate, at runtime.

Create allocates memory for a COM object, and then initializes the following properties:

Sets RefCount to 1, as a means of artificial reference counting in the case that the newly created object has a zero reference count and is passed as a parameter.

Sets Factory to the Factory parameter, which is the instance of the class factory responsible for creating the object.

Sets Controller to the Controller parameter, which is either a control object, if the object is part of an aggregate, or nil if it is not.

Calls on the COM server to increment the reference count of objects dependent on it.

Calls Initialize.

Decrements the RefCount that was artificially incremented.

See Also