IGPMessages Interface

Provides access to Geoprocessor messages.

When To Use

The IGPMessages returns the messages that are generated during validation and execution of a geoprocessing tool. The GPMessages object is a container of a collection of GPMessage objects.

For the Validate method, the messages are returned as an array of GPMessage objects. The layout of the returned array is the same as the input array of values, which is the same as the array of tool parameter descriptions.

Also refer to Building Geoprocessing Function Tools .

Members

Name Description
Method Add Adds a message object to the messages.
Method AddAbort Adds an abort message to the messages.
Method AddError Adds an error message to the messages.
Method AddMessage Adds an informative message to the messages.
Method AddMessages Adds all messages from an existing messages object to this messages object.
Method AddWarning Adds a warning message to the messages.
Read/write property Callback The callback object associated with the GPMessages object.
Method Clear Clears the message objects from messages object.
Read-only property Count The message count.
Method GetMessage Provides a message object from the specified location.
Method InitializeMessages Creates a number of empty messages and adds them to this messages object.
Read-only property MaxSeverity The maximum message severity.
Read-only property Messages The array of message objects.
Method Replace Replace an existing message in a specified location with a new message object.
Method ReplaceAbort Creates message of type esriGPMessageTypeAbort and replaces it into a specified position.
Method ReplaceError Creates message of type esriGPMessageTypeError and replaces it into a specified position.
Method ReplaceMessage Creates message and replaces it into a specified position.
Method ReplaceWarning Creates message of type esriGPMessageTypeWarning and replaces it into a specified position.

IGPMessages.Add Method

Adds a message object to the messages.

Public Sub Add ( _
    ByVal msg As IGPMessage _
)
public void Add (
    IGPMessage msg
);

Remarks

The Add method adds a GPMessage object to the GPMessages collection.

IGPMessages.AddAbort Method

Adds an abort message to the messages.

Public Sub AddAbort ( _
    ByVal Message As String _
)
public void AddAbort (
    string Message
);

Remarks

The AddAbort method creates a GPMessage of type esriGPMEssageTypeAbort and adds it to this collection.

IGPMessages.AddError Method

Adds an error message to the messages.

Public Sub AddError ( _
    ByVal ErrorCode As Integer, _
    ByVal Message As String _
)
public void AddError (
    int ErrorCode,
    string Message
);

Remarks

The AddError method creates a GPMessage of type esriGPMEssageTypeError and adds it to this collection.

IGPMessages.AddMessage Method

Adds an informative message to the messages.

Public Sub AddMessage ( _
    ByVal Message As String _
)
public void AddMessage (
    string Message
);

Remarks

The AddMessage method creates a GPMessage of type esriGPMEssageTypeInformative and adds it to this collection.

IGPMessages.AddMessages Method

Adds all messages from an existing messages object to this messages object.

Public Sub AddMessages ( _
    ByVal Messages As IGPMessages _
)
public void AddMessages (
    IGPMessages Messages
);

Remarks

The AddMessages method adds all messages from the input collection to this collection.

IGPMessages.AddWarning Method

Adds a warning message to the messages.

Public Sub AddWarning ( _
    ByVal Message As String _
)
public void AddWarning (
    string Message
);

Remarks

The AddWarning method creates a GPMessage of type esriGPMEssageTypeWarning and adds it to this collection.

IGPMessages.Callback Property

The callback object associated with the GPMessages object.

Public Property Callback As IGPMessagesCallback
public IGPMessagesCallback Callback {get; set;}

IGPMessages.Clear Method

Clears the message objects from messages object.

Public Sub Clear ( _
)
public void Clear (
);

Remarks

The Clear method empties a collection of GPMessage objects.

IGPMessages.Count Property

The message count.

Public ReadOnly Property Count As Integer
public int Count {get;}

Remarks

The get_Count property returns the number of GPMessage objects in this collection.

IGPMessages.GetMessage Method

Provides a message object from the specified location.

Public Function GetMessage ( _
    ByVal Index As Integer _
) As IGPMessage
public IGPMessage GetMessage (
    int Index
);

Remarks

The GetMessage property returns the specified GPMessage object from this collection.

IGPMessages.InitializeMessages Method

Creates a number of empty messages and adds them to this messages object.

Public Sub InitializeMessages ( _
    ByVal nMessages As Integer _
)
public void InitializeMessages (
    int nMessages
);

Remarks

The InitializeMessages method creates a number of empty messages and adds them to this collection.

IGPMessages.MaxSeverity Property

The maximum message severity.

Public ReadOnly Property MaxSeverity As esriGPMessageSeverity
public esriGPMessageSeverity MaxSeverity {get;}

Remarks

The get_MaxSeverity property returns the highest message type class in this collection. Valid values are defined and stored in the enumeration esriGPMessageSeverity ; they are: esriGPMessageSeverityInformative, esriGPMessageSeverityWarning, esriGPMessageSeverityError, and esriGPMessageSeverityAbort .

IGPMessages.Messages Property

The array of message objects.

Public ReadOnly Property Messages As IArray
public IArray Messages {get;}

Remarks

The get_Messages property returns all the GPMessage objects in this collection.

IGPMessages.Replace Method

Replace an existing message in a specified location with a new message object.

Public Sub Replace ( _
    ByVal Index As Integer, _
    ByVal msg As IGPMessage _
)
public void Replace (
    int Index,
    IGPMessage msg
);

Remarks

The Replace method replaces a message into a specified position in this GPMessages collection.

IGPMessages.ReplaceAbort Method

Creates message of type esriGPMessageTypeAbort and replaces it into a specified position.

Public Sub ReplaceAbort ( _
    ByVal Index As Integer, _
    ByVal Message As String _
)
public void ReplaceAbort (
    int Index,
    string Message
);

Remarks

The ReplaceAbort method creates a GPMessage of type esriGPMEssageTypeAbort and replaces it into a specified position in this GPMessages collection.

IGPMessages.ReplaceError Method

Creates message of type esriGPMessageTypeError and replaces it into a specified position.

Public Sub ReplaceError ( _
    ByVal Index As Integer, _
    ByVal ErrorCode As Integer, _
    ByVal Message As String _
)
public void ReplaceError (
    int Index,
    int ErrorCode,
    string Message
);

Remarks

The ReplaceError method creates a GPMessage of type esriGPMEssageTypeError and replaces it into a specified position in this GPMessages collection.

IGPMessages.ReplaceMessage Method

Creates message and replaces it into a specified position.

Public Sub ReplaceMessage ( _
    ByVal Index As Integer, _
    ByVal Message As String _
)
public void ReplaceMessage (
    int Index,
    string Message
);

Remarks

The ReplaceMessage method creates a GPMessage of type esriGPMEssageTypeInformative and replaces it into a specified position in this GPMessages collection.

IGPMessages.ReplaceWarning Method

Creates message of type esriGPMessageTypeWarning and replaces it into a specified position.

Public Sub ReplaceWarning ( _
    ByVal Index As Integer, _
    ByVal Message As String _
)
public void ReplaceWarning (
    int Index,
    string Message
);

Remarks

The ReplaceWarning method creates a GPMessage of type esriGPMEssageTypeWarning and replaces it into a specified position in this GPMessages collection.

Classes that implement IGPMessages

Classes Description

Remarks

The GPMessages object manages an array of GPMessage objects. This object contains methods to generate and replace message objects. The Validate() method returns a GPMessages object that contains one message for each parameter.

See alsoIGPMessage

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.