IMSCSMessageManager_3_0::GetMessage Method
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
Use this method to return the text of the specified message.
HRESULT IMSCSMessageManager_3_0::GetMessage(
BSTR bstrName,
VARIANT vtLanguage,
BSTR* Message
);
Function GetMessage(
bstrName As String,
vtLanguage As Variant
) As String
Parameters
bstrName
[C++][in] A BSTR 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.
[Visual Basic]
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
[C++][in] 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.
[Visual Basic]
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.
Message
[C++][out, retval] A pointer to a BSTR used to return the text of the specified message.
Return Values
[C++]
This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
[Visual Basic]
If this method completes successfully, it returns a String Variant that contains the text of the specified error message.
Error Values
[C++]
This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT 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, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
[Visual Basic]
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
[C++]
The Message parameter points to valid data only if the method returns successfully.
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.