RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Variant::GetActiveObject Method

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

Pascal
function GetActiveObject(const ProgID: String&): Variant; static;
C++
static __fastcall Variant GetActiveObject(const String& ProgID);

System::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 not registered, use the CreateObject member of System::Variant::Variant to run it.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!