COMCLASSINFO( ) Function

Returns registry information about a COM object such as a Visual FoxPro automation server.

COMCLASSINFO(oObject [, nInfoType])

Return Values

Character

Parameters

  • oObject
    An object reference to a COM or OLE object.
  • nInfoType
    Specifies the type of information to return. The following table lists the values for nInfoType and the information returned.
    nInfoType Information returned
    1 (Default) The object's programmatic identifier (ProgID).A ProgID is a registry entry that can be associated with a CLSID.
    2 The object's VersionIndependentProgID.The VersionIndependentProgID associates a ProgID with a CLSID. It is used to determine the latest version of an object application, refers to the application's class, and does not change from version to version.
    3 The object's friendly name.
    4 The object's class identifier (CLSID). A CLSID is a globally unique identifier that identifies a COM class object.
    5 Type of object passed:
       Return value      Description
             1               Visual FoxPro object
             2               ActiveX Control
             3               COM Component
             4               OLEBound object (General field)

Remarks

COMCLASSINFO( ) returns the empty string if registry information isn't available for the object you specify. Visual FoxPro automation servers are COM objects, both .exe executable files and .dll dynamic link libraries you can create in the Project Manager.

If you create an instance of an ActiveX control by using CREATEOBJECT( ) as in the following code, nInfoType returns 3 (COM Component) rather than 2.

X=CREATEOBJECT("mscomctlib.treectrl.2")

To return 2 (ActiveX control) you must use the object as such, as in the following code:

ox.addobject("oc","olecontrol","mscomctlib.treectrl.2")

See Also

COMARRAY( ) | CREATE PROJECT | CREATEOBJECT( ) | GETOBJECT( )