oleobj( <string> {,<file> {,<atable>}} )
component
Creates an instance of an external OLE Automation or ActiveX object and returns a pointer to it. The function returns the value null if the object cannot be created. This function is only available on Windows systems.
<string>
The class of Automation or ActiveX object.
<file>
The name of a file
to be used when the object needs to be saved. If this is omitted or is
an empty string, a suitable temporary file will be used and deleted at
the end of the session.
<atable>
An atable to be
used within any callbacks which the object exports.
component myobj = oleobj('MCI.MMControl')
When passing a parameter to a method of an OLE component, the value passed will be coerced into the OLE type expected by the method. However for a method which expects a type VARIANT of specific VARTYPE, the Fire value may be cast to the VARTYPE as in the following example.
component c = oleobj('MyObj.MyObj') c.Doit((I4)999)
Permitted casts are as follows:
(BOOL) - VT_BOOL
(CURR) - VT_CY
(DATE) - VT_DATE
(ERROR) - VT_ERROR
(I2) - VT_I2
(I4) - VT_I4
(OBJECT) - VT_DISPATCH
(R4) - VT_R4
(R8) - VT_R8
(STR) - VT_BSTR
(UI1) - VT_UI1