Home > Working with SGWorld > ISGWorld > OnSGWorldMessage
TerraExplorer can notify the client when a message object is about to be triggered. The client can then either handle the message itself or let TerraExplorer handle it.
The value returned in SourceObjectID determines how the MessageID is interpreted.
JavaScript |
|
OnSGWorldMessage( MessageID, SourceObjectID) |
C# |
|
bool OnSGWorldMessage( string MessageID, string SourceObjectID) |
C++ |
|
HRESULT OnSGWorldMessage( BSTR MessageID, BSTR SourceObjectID, VARIANT_BOOL* pbHandled) |
Parameters
MessageID
This value is interpreted based on the returning value of SourceObjectID below:
SourceObjectID
The ID of any of the following:
·
If sent by an ITerraExplorerObject6 derived object
– The ID of the object that owns the message object that is about
to be triggered.
In this case, the MessageID is the ID of the message object that is
about to be triggered.
· If sent by by IWindow6.ShowMessageBarText– “MessageBarText”. In this case, the MessageID contains the message text.
· If sent by non- ITerraExplorerObject6 derived object – “ContainerMessage”. In this case, the MessageID contains the ID of a temporary message object that can only be accessed during the scope of the event.
· If sent during FLY file load – “LoadFlyContainer”. In this case, MessageID contains a string combined from the container number, followed by a colon (“:”), followed by the URL to display.
Return Value
pbHandled
A Boolean that indicates whether or not the client handled the message itself and does not wish TerraExplorer to display the message. The value is FALSE when TerraExplorer handled the message.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.