This section explains how to perform the following tasks:
Declare messages.
Process messages.
Build a message table file.
To use the message macros, you must include both the VMM.INC and MSGMACRO.INC files in your VxD source files.
You declare messages using the DECLARE_MESSAGE and LONG_MESSAGE macros to specify the message text and identifiers, and by using the VxD_IMESSAGE_SEG, VxD_PMESSAGE_SEG, and VXD_MESSAGE_SEG macros to specify which data segment receives the message data. The following example shows how to declare messages for a VxD:
; Message table for initialization data segment
VxD_IMESSAGE_SEG
DECLARE_MESSAGE , \
<"Error interrupt conflict, please reinstall">
VxD_IMESSAGE_ENDS
; Messages table for locked data segment
VxD_MESSAGE_SEG
DECLARE_MESSAGE , \
<"Please reinsert the original disk.">
DECLARE_MESSAGE , \
<'Error: Can't open file "%0s" on drive "%1s".'>
; A long message
LONG_MESSAGE_START
LONG_MESSAGE <"Messages too long to fit on one line ">
LONG_MESSAGE <"can be divided among several lines.", 10, 13>
LONG_MESSAGE <"You can include control characters, such as ">
LONG_MESSAGE <"new line and carriage return", 10, 13>
LONG_MESSAGE_END
VxD_MESSAGE_ENDS
This example declares four messages. The MSG_BootErrorMsg, MSG_DiskPlease, and MSG_MyLongMessage messages are static messages. The MS_CantOpen message contains two parameter placeholders. The message macros automatically append a terminating null byte. Not illustrated is a pageable message segment, which uses the PMESSAGE type.
See also DECLARE_MESSAGE, LONG_MESSAGE, VXD_IMESSAGE_SEG, VXD_MESSAGE_SEG
Share with your friends: |