Microsoft Chat Server Development Guide

MsgFilter Sample

This extension monitors the text sent to a channel and filters (replaces with asterisks) all occurrences of any words it has defined in its filter list.

Description

This sample monitors all channel text for "illegal" strings, and replaces all occurrences (even those that appear as part of a longer string) with asterisks. It also demonstrates how to include a custom interface for administration of extension data. An additional property page can access the instance of the extension running on a chat server and add words to its filter list.

The main ATL object implementation file is MessageFilter.cpp. The file declares CMessageFilter, which implements the interfaces required by a chat extension. It also implements the ISpecifyPropertyPages interface to allow the MMC chat administration to query for the property pages. The MsgFilterPP.cpp file implements the property page object. This property page is used by the Chat Service Manager to navigate the chat object model to retrieve a reference to the instance of the extension running on the chat server.

Installation

This sample is built using Microsoft Visual C++ 5.0 and ATL. You must have Microsoft Exchange Chat Service V5.5 SP1 installed.

The project's workspace and makefile will register the extension when compiled. You can use regsvr32 to register the DLL on any additional machine (for example, for remote administration using MMC).

To install the sample:

  1. Run "regsvr32 MsgFilter.dll" from the command line to register the extension.
  2. Run Chat Service Manager.
  3. Select the local server. Right-click on Extensions, and select New, then Add Extension….
  4. Select "MessageFilter Class" from the list, and click OK.
  5. Restart the chat service.

Source Listing

The following files can be found in the chat documentation installation directory, in Samples\vc5\MsgFilter:

File Purpose
MessageFilter.cpp MsgFilter object implementation
MessageFilter.h MsgFilter object declarations
MsgFilter.dll Chat server extension DLL
MsgFilterPP.cpp MsgFilter property page implementation
MsgFilterPP.h MsgFilter property page class declaration


© 1998 Microsoft Corporation. All rights reserved.