Click to Rate and Give Feedback
MSDN
MSDN Library
Using WMI
 Creating a New Permanent Event Cons...

  Switch on low bandwidth view
Creating a New Permanent Event Consumer Class

One of the first steps in creating a permanent event consumer is to create the WMI class that describes the event consumer. Specifically, the permanent event consumer class defines the parameters of the action implemented by the physical consumer.

The following procedure describes how to create a permanent event consumer class.

Aa389755.wedge(en-us,VS.85).gifTo create a permanent event consumer class

  1. Derive a class from the __EventConsumer system class.
  2. Implement any parameters necessary to process an event notification.

The following example shows the syntax used to create the SMTPConsumerEvent class. You can use this as an example for creating your new class. The SMTPEventConsumer class sends an e-mail message by using Simple Mail Transfer Protocol (SMTP) each time an event is delivered to it. This class is defined in smtpcons.mof.

class SMTPEventConsumer : __EventConsumer
{
  [key] string Name;
  [not_null] string SMTPServer;
  [Template] string Subject;
  [Template] string FromLine;
  [Template] string ReplyToLine;
  [Template] string Message;
  [Template] string ToLine;
  [Template] string CcLine;
  [Template] string BccLine;
  string HeaderFields[];
};

You should be able to create instances of your permanent event consumer class to describe one or more ways to send events to your physical consumer. For more information, see Creating a Logical Consumer.

Send comments about this topic to Microsoft

Build date: 6/15/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker