Platform SDK: Chat Server

LogMonitor (C++) Sample

This extension monitors for chat users login/logout notifications and outputs a report to a text file (C:\CHATSESS.LOG).

Description

This sample demonstrates event bindings for user creation and deletion notifications. On receiving the OnNewUser event notification, it stores the user's nickname and logon time in a collection. When the OnCloseUser event occurs, it logs the user's nickname, connect time and disconnect time to a text log file (C:\CHATSESS.LOG).

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 LogMonitor.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 "SessionMonitor 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\LogMonitor:

File Purpose
LogMonitor.dll Chat server extension DLL
SessionMonitor.cpp CSessionMonitor implementation
SessionMonitor.h CSessionMonitor declaration