Retrieving Announcement Attributes

[This is preliminary documentation and subject to change.]

A receiving application, when spawned, may need to access any number of attributes from the original announcement. For example, when a stock ticker application is launched in response to announcement, it should display an appropriate title, depending on an attribute in the announcement (such as a = market:NYSE).

When the application is spawned, however, the original announcement is no longer available. Fortunately, the Task Scheduler stores the full text of the announcement, including all session attributes, in the user data for the task. The Task Scheduler supplies the name of the task that launched the receiving application in the command line passed to the receiving application. (For more information, see Receiver Application Command Line.)

The most convenient way to access the attributes in the task is to create a new broadcast announcement and fill it with the stored information from the task. Calling the ITask::GetUserData method in the Task Scheduler interface, and passing the result to the IBroadcastAnnouncement::Load method, fills an empty broadcast announcement with data from the Task Scheduler. The resulting announcement appears as though it had just been received by Announcement Listener over an announcement channel.

The application is now able to access the attributes using the same announcement interface that announcement filters use.