GetObjectEx

Returns an interface to the object based on a requested ITerraExplorerObject derived interface. For example, if you want to get an ITerraExplorerObject5 interface pass “ITerraExplorerObject5” to the InterfaceName parameter.

 

When using TerraExplorer Viewer the method returns the interface for ITerraExplorerMessage5 objects only. For ObjectID’s of objects from different types (See ITerraExplorerObject5::ObjectType) TE_E_NOLICENSE is returned. The available properties for the returned ITerraExplorerMessage5, in this case, are read-only.

Supported by TerraExplorer Viewer.

 

HRESULT GetObjectEx(

[in] long ItemID,

[in, optional, defaultvalue("")] VARIANT InterfaceName,

[out, retval] VARIANT* obj)

Parameters:

 

Return Values:

The return value obtained from the returned HRESULT can be one of the following:

 

Return value

Meaning

S_OK

Success.

E_FAIL

Catastrophic failure.

TE_E_MPTNOTLOADED

An MPT file must be loaded in TerraExplorer for this method to work.

TE_E_NOLICENSE

You are running TerraExplorer Viewer and therefore do not have permission to work with this interface.

E_INVALIDARG

There is a problem with one or more of the arguments passed to this method. Use the IErrorInfo interface to extract more information about this error.

TE_E_INFOTREE_ITEMISGROUP

ItemID is a group so an object cannot be retrieved.

TE_E_OBJMANAGER_OBJNOTFOUND

Object was not found or no longer exist