MessageManager.GetMessage Method (PIA)
Use this method to return the text of the specified message.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop
…
Public Function GetMessage(bstrName As String,
vtLanguage As Object) As String
[C#]
using Microsoft.CommerceServer.Interop;
…
public string GetMessage(stringbstrName,
objectvtLanguage);
Parameters
[Visual Basic .NET]
- 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
An Object 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.
[C#]
- 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
An object 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 (Type.Missing), or is null, the message is returned for the message set identified by the DefaultLanguage property of the MessageManager object.
Return Values
[Visual Basic .NET] If this method completes successfully, it returns a String that contains the text of the specified error message.
[C#] This method returns a string containing the text of the specified message.
Exceptions
This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.
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.
[Visual Basic .NET]
Example
' oMessageManager is a Commerce.MessageManager object
oMessageManager.GetMessage("pur_out_of_stock", "us")
Requirements
Namespace: Microsoft.CommerceServer.Interop
Platforms: Windows 2000, Windows Server 2003
Assembly: mscsasphelplib (in mscsasphelplib.dll)
See Also
Copyright © 2005 Microsoft Corporation.
All rights reserved.