SET OLEOBJECT Command

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

SET OLEOBJECT ON | OFF

Parameters

  • ON
    (Default) Specifies that Visual FoxPro search the registry when an object cannot be located.

  • OFF
    Specifies that Visual FoxPro does not search the 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 registry.

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.

See Also

Reference

CREATEOBJECT( ) Function

GETOBJECT( ) Function

DO Command

SET Command Overview

Other Resources

Commands (Visual FoxPro)

Language Reference (Visual FoxPro)