Description

Create a COM object, and if an “operator”, store a connection to it in the Object Manager.

Return Type

An Unknown object.  

retval

Syntax

object.CreateObject (ProgIDorCLSID)

The CreateObject Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McEngine.
ProgIDorCLSIDRequired. A String value.

Registered Prog ID of the “coclass” of this object. Or the CLSID in a form like “{DC2F6FCB-08A7-40c0-BBDB-D3894B1C5F68}”; the braces are required. If the class has already been registered with the McObjects object manager, then just the registered type name is required. The registered type name is the portion of the ProgID after the first period up to any second period. All coclasses in the Image Pro type library are registered at start up, so as illustrated in the example, you can just use the type name for virtually all “operators”.

Remarks

This function provides an extension of the standard VBA CreateObject method that handles classes that are “operators” as well as ordinary COM classes. An instance of the specified class is created, and then an “operator” (an interface implementing IMcHasObject) is registered in the McObjects Object Manager. Registration with McObjecs enables the interface code to receive notifications and access other registered objects like Engine or Engine.Images.

The CreateOperator method is the preferred method for creating “operators”. This method is mostly a fallback to ensure that a version of the standard “CreateObject” method is available that properly registers operators.