Status Message Overview

Users must understand the storage and display of status messages in order to interpret the fragments of information in the SMS status message objects. Instances of status messages are assembled by combining information from these objects with strings stored in DLLs. The SMS status objects link instance-specific information (such as file names) with cached message strings to create display strings of message instances.

An SMS status message viewed in the SMS Administrator console appears as a display string similar to this example:

“SMS component copied file \\<ServerName>\<ShareName>\File.txt to c:\Temp\File.txt”

It would be inefficient for SMS to store these strings in the site database. Instead, it stores a “string ID” (which is the value of SMS_StatusMessage.MessageID added to the value of SMS_StatusMessage.Severity) and a number of “insertion strings.”

The string ID identifies a string template kept in a DLL that is specified by SMS_StatusMessage.ModuleName. A string template looks like:

“SMS component copied file %1 to %2.”

The two insertion strings in this example are “\\<ServerName>\<ShareName> \File.txt” and “c:\Temp\File.txt”. These are stored as instances of class SMS_StatMsgInsStrings.

You can find the name of the DLL that contains the string template by looking up SMS_StatMsgModuleNames.MsgDLLName for a specified value of SMS_StatusMessage.ModuleName).

When a program, such as the SMS Status Message Viewer, displays a message to the user, it first obtains the SMS_StatusMessage instance for the message, plus all insertion strings (SMS_StatMsgInsStrings) associated with the message. It then looks up the DLL name, and loads it using Win32 LoadLibrary(). Finally, it calls Win32 FormatMessage(), passing in the “string ID” and the instances of SMS_StatMsgInsStrings.InsStrValue.