Microsoft Chat Server Development Guide

LogMonitor (VB) Sample

This extension monitors for chat users login/logout notifications and reports sessions to a text file (C:\CHAT.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:\CHAT.LOG).

The sample also demonstrates how to add support for a property page that allows the administrator to enable and disable logging from the Chat Service Manager. The property page is implemented by the ChatServerPP project found in the "PropertyPage" subdirectory.

Installation

This sample is built using Microsoft Visual Basic 5.0. You must have Microsoft Exchange Chat Service V5.5 SP1 installed.

To install the sample:

  1. Run "regsvr32 LogMonitor.dll" from the command line to register the extension.
  2. Run regcatid.reg by double-clicking from Windows NT Explorer.
  3. Run Chat Service Manager.
  4. Select the local server. Right-click on Extensions, and select New, then Add Extension….
  5. Select "LogMonitorExtension.LogMonitor" from the list, and click OK.
  6. Restart the chat service.

Source Listing

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

File Purpose
LogMonitor.cls Visual Basic class module
LogMonitor.dll Chat server extension DLL

The following files can be found in the chat documentation installation directory, in Samples\vb5\LogMonitor\PropertyPage:

File Purpose
ChatServerPP.pag Visual Basic property page layout
LogMonitorPP.ocx LogMonitor property page component


© 1998 Microsoft Corporation. All rights reserved.