COM Object instantiation can be manipulated via the peAutoCreate property.
For Automation objects the default value for this property is acNoAutoCreate. This means that you must manually instantiate the COM object using CreateComObject. You would normally not change this default.
For ActiveX controls the default peAutoCreate value is acDeferredAutoCreate. This causes the COM object to automatically instantiate when it is paged (during Activate), and to be automatically destroyed when it is unpaged (during Deactivate).
For ActiveX controls you also have the option of setting peAutoCreate to acAutoCreate. This automatically instantiates the COM object when its DataFlex COM wrapper object is created. This means that the COM object will now exist and retain its state even when it’s not paged, just like any other DataFlex control. This might seem like the most desirable setting for all ActiveX controls but you need to be careful when using the acAutoCreate setting. Certain ActiveX controls exhibit problems when invoking methods and setting properties while they're not displayed. For that reason the setting of acDeferredAutoCreate is considered safe in all cases. If you want your ActiveX control to retain its state while it is not visible, then you can use the acAutoCreate setting but it will be up to you to ensure that the control will operate without errors.
Some ActiveX controls are not visible by design. In these cases it is better for the COM object to be created at the same time as its DataFlex wrapper. This is because controls that are invisible, are controls that won't have any problems with setting properties when they're not displayed (they will never be displayed). Also, controls that are invisible are also controls that you are likely to want to use as soon as the DataFlex wrapper object has been created. The FlexCOM class generator has been designed to take this into consideration. It now detects whether the object is invisible at runtime, and then sets peAutoCreate to acAutoCreate in case it's invisible at runtime, otherwise it sets it to acDeferredAutoCreate.