Formats a command or event generated by a service managed by this service manager.
DWORD xxxFormatMessage (DISP_MESSAGE *pmsg, char *msgtext, unsigned size, char *indent)
|
Argument |
Description |
|
pmsg |
Pointer to the DISP_MESSAGE structure: typedef struct |
|
msgtext |
Pointer to a character string to receive the formatted message. |
|
size |
Size of msgtext. |
|
indent |
Pointer to a character string to be placed at the beginning of each newly formatted line. |
SUCCESS
xxxFormatMessage formats a dispatcher command or event into a user-readable text format. The DISP_MESSAGE structure contains the fields necessary to determine whether the message is a command or an event. Once this is known, the function can cast the pointer to the appropriate DISP_COMMAND or DISP_EVENT structure and format it appropriately.
msgtext is passed in by the dispatcher and its size should be checked so that the service only copies as much text as can fit into the string without overwriting the end and causing a protection violation. Typically, services format their messages into an internal buffer big enough to hold the text of any message produced by the service. It then copies as much as it can to msgtext.
indent should be prepended to the beginning of each new text line by the formatting routine. This gives the application some control over how events are printed if this function is called from ctaFormatEvent.
For more information about this function, refer to Runtime binding functions.