Introduction to Virtual Device Drivers



Download 274.5 Kb.
Page73/80
Date19.01.2022
Size274.5 Kb.
#58083
1   ...   69   70   71   72   73   74   75   76   ...   80
VXDS

Message Processing


You process messages by using the message usage macros. These macros let you retrieve the addresses of the message strings and optionally modify the content of the strings by replacing parameter placeholders with current values. In general, you must process messages to prepare them for displaying.

Messages that are intended to be displayed as declared are called static messages. You process a static message by simply retrieving the address of the message using the GET_MESSAGE_PTR macro.

Messages that contain parameter placeholders are intended to be modified before being displayed. A parameter placeholder is a character sequence that starts with a percent sign (%) and includes a parameter number and a format code. You process such messages by using the PUSH_SPRINTF macro, supplying the message identifier and the values to modify the string with. The macro uses the original message to create a new string in which each parameter placeholder is replaced with the corresponding value. The macro places the new string on the stack and returns the address of the string.

You should display any string you create using PUSH_SPRINTF as soon as possible, then remove the string by using the POP_SPRINTF macro. If necessary, you can retrieve the length of the new string by using the PUSHED_SPRINTF_LENGTH macro, but you must do this before push any other item on the stack and certainly before removing the string from the stack.

See also GET_MESSAGE_PTR, POP_SPRINTF, PUSH_SPRINTF, PUSHED_SPRINTF_LENGTH


Download 274.5 Kb.

Share with your friends:
1   ...   69   70   71   72   73   74   75   76   ...   80




The database is protected by copyright ©ininet.org 2024
send message

    Main page