The IMessageText class loads message text from a message file. When the Open Class Library detects an error condition and prepares to throw an exception, the library creates an object of this class if it is using customized message text. You can use the message text provided by this class to construct an object of a class derived from IException.
You can override the name of the default message file by setting the environment variable ICLUI_MSGFILE to the name of the preferred message file.
The IMessageText object searches for the message file using the NLSPATH environment setting.
You can construct, destruct, copy, and assign objects of this class.
![]() |
public:
~IMessageText()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IMessageText(const IMessageText& text)
You can construct objects of this class using the Open Class Library-provided copy constructor.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IMessageText( unsigned long messageId, const char* messageFileName = IMessageText::messageFile ( ), const char* textInsert1 = 0, const char* textInsert2 = 0, const char* textInsert3 = 0, const char* textInsert4 = 0, const char* textInsert5 = 0, const char* textInsert6 = 0, const char* textInsert7 = 0, const char* textInsert8 = 0, const char* textInsert9 = 0 )
You can construct objects of this class using this constructor, allowing you to retrieve a message from a file and, optionally, insert additional text strings within the retrieved message.
You can specify that the object insert the text strings through substitution symbols within the message. For example:
The application cannot find the file, %1, at the specified path, %2.Using this constructor, you can replace the substitution symbols by supplying the file name and path name via textInsert1 and textInsert2 respectively. Notice the substitution symbol number (%1) matches the parameter number (textInsert1).
Attention:
If you specify 0,
the message text is in a message segment bound to the .EXE.
The IMessageText object loads the message from the application.
Otherwise, the library searches for the message text in the specified message file.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Assigns one message text object to another
![]() |
public:
IMessageText& operator =(const IMessageText& text)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to get or set the message file name.
![]() |
public:
static char* messageFile()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static void setMessageFile(const char* msgFileName)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to obtain the text from the object and to set the default text for the object.
![]() |
public:
operator const char *() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IMessageText& setDefaultText(const char* text)
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
int successful() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
const char* text() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |