CoGetObject

InstallShield 2015 » InstallScript Language Reference

Project: This information applies to InstallScript projects.

The CoGetObject function returns a reference to the specified COM object (as Visual Basic’s GetObject function does); that reference can be assigned to a variable of type OBJECT by using the set keyword.

Syntax

CoGetObject ( szFilename, szProgID );

Parameters

CoGetObject Parameters

Parameter

Description

szFilename

Specifies the fully qualified name of the COM object. This parameter can be a null string ("") if szProgID is non-null.

szProgID

Specifies the program ID of the COM object. This parameter can be a null string ("") if szFilename is non-null.

Return Values

A reference that can be assigned to a variable of type OBJECT by using the set keyword.
Any object variable can be released by setting the object variable to the value of NOTHING or reassigning the object with the CoCreateObject, CoCreateObjectDotNet, CoGetObject, or DotNetCoCreateObject functions. However, this does not automatically unload the library referenced by the object. You must call the Windows API, CoFreeLibrary, manually to free the library. Otherwise, the library remains loaded until the installation finishes. For more information, see Extending Your Installation with COM Objects.

Additional Information

To check whether the object was initialized successfully, call the IsObject function.

See Also