CreateMessage

In TerraExplorer, a message is an object which is displayed in a container (e.g., pop-up window) and which defines a content type (e.g., HTML or simple text). The message is triggered when the user clicks on an object (or clicks on a Fly-To link to the object) which is associated with that message object. When a message object is triggered, the message content is displayed in the message-defined client.

Usually after creating a message object, the client associates it with an object by setting that object MessageID property to the ID of the newly created message (See ISingleMessageObject5::MessageID property). Several different objects can be associated to the same message object at the same time.

 

Note: When TerraExplorer runs as an ActiveX component (like in the SkylineGlobe web site) only the HTML Pop-up containers are visible to the user. However, in order to catch and analyze those messages you can target them to other containers.  To do so listen to the _ITerraExplorerEvents4::OnTerraExplorerMessage() event notification.

 

 

HRESULT CreateMessage (

[in] MsgClient Client,

[in] BSTR Data,

[in] MsgType Type,

[in, optional, defaultvalue(0)] _HTML_POPUP_FLAGS PopupFlags,

[in, optional, defaultvalue("")] BSTR PopupCaption,

[in, optional, defaultvalue(-1)] double PopupTimeout,

[in, optional, defaultvalue(0)] int PopupTopLeftX,

 [in, optional, defaultvalue(0)] int PopupTopLeftY,

[in, optional, defaultvalue(0)] int PopupWidth,

[in, optional, defaultvalue(0)] int PopupHeight,

[in, defaultvalue(FALSE)] BOOL BringToFront,

[out, retval] ITerraExplorerMessage5** pITerraExplorerMessage5)

 

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_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:

Several objects can own the message object that is created by this method. A rectangle for example, may own a message object that is also owned (at the same time) by a circle object. This means that both objects, the rectangle and the circle, display the same message when clicked upon.