CreateObjectEx()
Distributed computing arrives at last! This function lets you create objects external to the machine you're working on.
Usage |
oHandle = CreateObjectEx( cCLSID | cProgID [ , cComputer ] [, cInterfaceID ] ) |
Parameter |
Value |
Meaning |
cCLSID |
Character |
The class identifier of the object you're trying to create, typically in the form returned by the CLSID property ({HhHhHhHh-HhHh-HhHh-HhHh-HhHhHhHhHhHh}, where each "Hh" is a hexadecimal representation of one byte. This format is also known as a GUID). |
cProgID |
Character |
The programmatic identifier for the class. This is the "friendly name" of the COM server, as stored in the Registry. For example, "Word.Application". |
cComputer |
Character |
The name of the computer on which this object is created. The name can be in Universal Naming Convention (UNC) format, as in "\\ServerName," or in another format that can be resolved to an individual machine name, such as a TCP/IP address or domain name. Services to resolve the addresses must be available to the machine. |
Omitted |
Create the object on the local machine. |
|
cInterfaceID |
Character |
The GUID of the interface identifier of the object you're creating. Creates an early bound instance of the object. |
Omitted or empty string |
Attempts to instantiate the default interface. Creates an early bound instance of the object, if possible. |
|
Omitted |
Creates a late bound instance of the object. |
|
oHandle |
Object |
Returns a handle to the object if created successfully. In our experience, failure to create the object typically brings up the error handler. |
Example |
oProj = _vfp.ActiveProject && Get a handle to the project cCLSID = oProj.Servers[1].CLSID && Get 1st server's class ID oWow = CreateObjectEx(cCLSID,"","") && Create the object |
See Also |