GetInterface()
GetInterface() allows early binding of COM objects, available beginning in VFP 7. Early binding is where VFP figures out the pointers to the COM object's interface at compile time. Prior to VFP 7, objects could only be late bound, meaning that VFP figures out the pointers on every call. As you can guess, early binding generally gives a performance benefit.In addition to providing an early-bound object reference (and providing design-time IntelliSense help, and runtime performance benefits), you can also access any interfaces that the COM object exposes.
Usage |
oInterface = GETINTERFACE( oObject [ , cInterface [ , cIdentifier ] ] ) |
Parameter |
Value |
Meaning |
oObject |
Object |
The COM object. |
cInterface |
Omitted |
Returns the early binding interface. |
Character: GUID |
The GUID of the COM object's interface to which you want a reference. |
|
Character |
The name of the interface, for example, "IEmployee". |
|
cIdentifier |
Character |
A character string specifying either the name of the type library or the ProgID of the class. |
oInterface |
Object |
The early-bound reference to the COM object, using the specified interface. |
Example |
* Assume a COM object called oMyObject is instantiated, * and it has an interface called Icustomer. oEarlyObject = GETINTERFACE(oMyObject, "ICustomer") |
See Also |