System.Variant.GetActiveObject

From RAD Studio API Documentation
Jump to: navigation, search

C++

static Variant __fastcall GetActiveObject(const String& ProgID);

Properties

Type Visibility Source Unit Parent
function public sysvari.h System Variant

Description

Retrieves a reference to an IDispatch interface of a currently running, registered OLE Automation object and returns it as a Variant.

GetActiveObject returns a reference to the IDispatch interface of the active object for the given class indicated by ProgID. ProgID is the programmatic ID for the class of the active object from the OLE registration database.

If either the class object or the IDispatch interface is not successfully returned, an EOleSysError exception is thrown.

Tip: If the Automation object is not running or is not registered, use the CreateObject member of Variant to run it.

See Also