This method creates an Information Tree entry that has only a hotlink that is not attached to a terrain object.
HRESULT CreateTreeHotlink (
[in] BSTR MessageID,
[in, defaultvalue(0)] long GroupID,
[in, defaultvalue("")] BSTR Description,
[out, retval] ISingleMessageObject5** pISingleMessageObject5)
Parameters:
MessageID – The ID of the message object that the client wants to have activated once the user clicks on that entry in the Information Tree.
GroupID – The Information Tree group in which the hotlink is created. If it is set to zero, the object created in the route. You can obtain the GroupID by one of the following methods:
Create the group the IInformationTree5::CreateGroup.
If you know the name of the group, find it using IInformationTree5::FindItem.
Traverse the Tree using IInformationTree5 methods such as GetNextItem, until you come to the desired GroupID.
Description – The name of the hotlink as it appears in the Information Window. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.
pISingleMessageObject5 – An interface pointer to the newly created hotlink. This parameter must not be Null.
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_INFOTREE_PARENTNOTGROUP |
The group ID entered does not represent a valid group in the information tree. |
TE_E_INTERNAL |
TerraExplorer was unable to create the object. To get more information about this error use the IErrorInfo Interface. |
TE_E_NOLICENCE |
Your license does not allow the use of this feature. |
Remarks:
In most cases, if an entry in the Information Tree is not a group, it usually represents an object on the terrain. It is, however, sometimes necessary to create an entry in the Information Tree that can be linked to a web page, for example, without the link actually being related to a terrain object. To create a tree hotlink, you should first create a message object (using the CreateMessage() method) and then pass the ID of that message object to the CreateTreeHotlink() method.