Specifies whether Visual FoxPro searches the registry when an object cannot be located.
SET OLEOBJECT ON | OFF
- (Default) Specifies that Visual FoxPro search the registry when an object cannot be located.
- Specifies that Visual FoxPro does not search the 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).
When Visual FoxPro searches for an object, the registry is searched last. Visual FoxPro loads COM object support before it searches the 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 COM support, issue SET OLEOBJECT OFF to prevent Visual FoxPro from searching the registry when an object cannot be located.
SET OLEOBJECT does not affect COM objects in Forms or General fields. Visual FoxPro always loads COM object support when a Form containing a COM object is opened for modification or is instantiated, or a table with a general field is opened.
Because GETOBJECT(В )activates a COM object, Visual FoxPro generates an error when GETOBJECT(В ) is issued and SET OLEOBJECT is OFF.