MessageManager.GetMessage

Ee811410.c++_on(en-US,CS.10).gifEe811410.vb_off(en-US,CS.10).gif

Use this method to return the text of the specified message.

Definition

Function GetMessage(bstrName As String,vtLanguage As Variant) As String

Parameters

bstrName

A String that contains the message constant name of the message to return. This is the name associated with this message when it was added to the MessageManager object through a call to the AddMessage method.

vtLanguage

A Variant that specifies the name of the message set to which the message text belongs. This string specifies a message set that was added to the MessageManager object through a previous call to the AddLanguage method. If this parameter is not specified, or is NULL, the message is returned for the message set identified by the DefaultLanguage property of the MessageManager object.

Return Values

If this method completes successfully, it returns a StringVariant that contains the text of the specified error message.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

The GetMessage method is seldom called from within a site. Instead, it is used by pipeline components to retrieve messages that describe errors that have occurred.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' oMessageManager is a Commerce.MessageManager object
oMessageManager.GetMessage("pur_out_of_stock", "us")

See Also

MessageManager Object

MessageManager.AddLanguage

MessageManager.GetLocale


All rights reserved.