SET OLEOBJECT Command

Specifies whether Visual FoxPro searches the OLE Registry when an object cannot be located.

SET OLEOBJECT ON | OFF

Parameters

  • ON
    (Default) Specifies that Visual FoxPro searches the OLE Registry when an object cannot be located.
  • OFF
    Specifies that Visual FoxPro does not search the OLE Registry when an object cannot be located.

Remarks

When an object is created with CREATEOBJECT( ) or GETOBJECT( ), Visual FoxPro searches for the object in the following locations and order:

  1. The Visual FoxPro base classes.
  2. Class definitions in memory in the order they are loaded.
  3. Class definitions in the current program.
  4. Class definitions in the .vcx class libraries opened with SET CLASSLIB.
  5. Class definitions in procedure files opened with SET PROCEDURE.
  6. Class definitions in the Visual FoxPro program execution chain (For Details, See DO Command).
  7. The OLE Registry.

When Visual FoxPro searches for an object, the OLE Registry is searched last. Visual FoxPro loads OLE support before it searches the OLE Registry, increasing the amount of memory required by Visual FoxPro and reducing the amount of memory available to other applications.

If you are developing an application that does not require OLE support, issue SET OLEOBJECT OFF to prevent Visual FoxPro from searching the OLE Registry when an object cannot be located.

SET OLEOBJECT does not affect OLE objects in Forms or General fields. Visual FoxPro always loads OLE support when a Form containing an OLE object is opened for modification or is instantiated, or a table with a general field is opened.

Because GETOBJECT( ) activates an OLE object, Visual FoxPro generates an error when GETOBJECT( ) is issued and SET OLEOBJECT is OFF.

See Also

CREATEOBJECT( ) | GETOBJECT( ) | DO Command