다음을 통해 공유


IMSCSMessageManager_3_0::AddMessage Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Use this method to add a message to the MessageManager object.

HRESULT IMSCSMessageManager_3_0::AddMessage(
 BSTR bstrName,
 BSTR bstrMessage,
 VARIANT vtLanguage
);
Sub AddMessage(
  bstrName As String,
  bstrMessage As String,
  vtLanguage As Variant
)

Parameters

  • bstrName
    [C++]

    [in] A BSTR that contains the message name constant, which is a string that identifies the message to add. For a list of common messages and their constant names, see the Remarks section.

    [Visual Basic]

    A String that contains the message name constant, which is a string that identifies the message to add. For a list of common messages and their constant names, see the Remarks section.

  • bstrMessage
    [C++]

    [in] A BSTR that contains the text of the message to add.

    [Visual Basic]

    A String that contains the text of the message to add.

  • vtLanguage
    [C++]

    [in] A VARIANT that contains the language name with which to associate the message. This value, if specified, must be a language name added through a previous call to the AddLanguage method. If this parameter is not supplied, or is NULL, the language specified in the DefaultLanguage property of the MessageManager object is used.

    [Visual Basic]

    A Variant that contains the language name with which to associate the message. This value, if specified, must be a language name added through a previous call to the AddLanguage method. If this parameter is not supplied, or is NULL, the language specified in the DefaultLanguage property of the MessageManager object is used.

Return Values

[C++]

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

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

The following table lists the messages that are used by the default implementation of the Order Processing pipeline (OPP), showing the message name constant expected by the OOP components that use these messages.

Message name constant

Used by OPP component

Added to this collection under this condition

pur_badplacedprice

RequiredItemAdjustPrice

_Basket_Errors when the price of an item does not correspond to the price contained in the order form

pur_badhandling

RequiredHandling

_Purchase_Errors when the handling cost for an order cannot be computed

pur_badpayment

RequiredPayment

_Purchase_Errors when authentication code (_payment_auth_code) is not set

pur_badshipping

RequiredShipping

_Purchase_Errors when the shipping costs for an order cannot be computed

pur_badsku

RequiredProdInfo

_Basket_Errors when a stock-keeping unit (SKU) in the order form references an item that is not contained in the inventory for the site

pur_badtax

RequiredTax

_Purchase_Errors when the tax on a purchase cannot be computed

pur_badverify

RequiredTotal

_Purchase_Errors when the data stored by the ProcessVerifyWith method does not match the original data in the order form

pur_noitems

RequiredOrderCheck

_Purchase_Errors when there are no items in the order form

pur_out_of_stock

FlagInventory, LocalInventory

_Purchase_Errors when an item referenced in the order form is out of stock

See Also

Other Resources

MessageManager Object