Working with IMessageBox Parts

The following tasks are associated with using an IMessageBox* part in visual composition. Tasks that are common to many parts are described in related topics.

Defining a message box title
To define a title for the message box, set the Title property in the IMessageBox* property sheet. Enter the title in the value column.

Assigning ownership
An IMessageBox* part serves the frame window that owns it. If you have only one frame window in a composite part, the IMessageBox* part is automatically owned by that frame window. To provide a message box for an additional frame window, do the following:

Showing exceptions
To report exceptions in the message box, connect theexceptionOccurred event of each connection that could yield an exception to the IMessageBox* showException action. The exception text is provided in an exception object.

Optionally, you can specify additional information for an exception. Open settings for the connection and select Set parameters. In the Constant Parameter Value Settings window, set the following parameters:

exception
To specify exception text instead of using text from an exception object, enter text in the code prompter for the value column. The exception text must be entered as a C++ string enclosed in quotation marks.

helpId
If you have defined help for the exception, specify the help ID in the value column.

Showing messages
To show messages in the message box, do the following:
  1. Connect an event for each message to the IMessageBox* show action.

  2. Open settings for the connection and select Set parameters. In the Constant Parameter Value Settings window, set the following parameters:

    helpId
    If you have defined help for the message, specify the help ID in the value column.

    message
    Enter the message text in the code prompter for the value column. The message text must be entered as a C++ string enclosed in quotation marks.

    severity
    Enter the message severity in the code prompter for the value column. The severity must be one of the following enumeration values, which are defined in the IMessageBox class:
    • IMessageBox::information
    • IMessageBox::warning
    • IMessageBox::action
    • IMessageBox::critical
    • IMessageBox::catastrophic


Related procedures
Working with VisualAge User Interface Parts

Related references
IMessageBox
Property Settings -- IMessageBox
Portability -- IMessageBox