SET OLEOBJECT Command
Specifies whether Visual FoxPro searches the OLE Registry when an object cannot be located.
SET OLEOBJECT ON | OFF
- (Default) Specifies that Visual FoxPro searches the OLE Registry when an object cannot be located.
- Specifies that Visual FoxPro does not search the OLE Registry when an object cannot be located.
When an object is created with CREATEOBJECT( ) or GETOBJECT( ), Visual FoxPro searches for the object in the following locations and order:
- The Visual FoxPro base classes.
- Class definitions in memory in the order they are loaded.
- Class definitions in the current program.
- Class definitions in the .vcx class libraries opened with SET CLASSLIB.
- Class definitions in procedure files opened with SET PROCEDURE.
- Class definitions in the Visual FoxPro program execution chain (For Details, See DO Command).
- 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.