RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TComObject.CreateFromFactory Constructor

Instantiates a COM object and initializes its values.

Pascal
constructor CreateFromFactory(Factory: TComObjectFactory; const Controller: IUnknown);
C++

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. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!