Microsoft Internet Security and Acceleration Server 2000

Creating the COM Filter Object

To begin developing an application filter, create a new project, and then include the necessary header and .idl files. For more information about these declaration files, see Header and .Idl Files Provided with ISA.

To create the COM filter object

  1. Create a new project (using the ATL COM AppWizard) with the following properties:
  2. Add the header and .idl files to the project.

    In the Project Settings dialog box, in the Settings For drop-down menu, select All Configurations. Then, select the C/C++ tab, and from the Category drop-down menu select Preprocessor. In the Additional include directories entry field, add the path to the SDK inc directory to the include path of the project. Type the same path information in the Additional include directories entry field of the MIDL tab, and click OK.. Then add wspfwext.idl and msfpccom.idl from ISA SDK's inc directory to the project's source files.

    To include all the interface definitions and their GUIDs that are required to build a filter (for example, IFWXFilter, IFWXSessionFilter, or IFWXDataFilter), import wspfwext.idl at the beginning of the SMTPFLTR.idl file:

    import "oaidl.idl"; 	// line produced by the wizard
    import "ocidl.idl"; 	// line produced by the wizard
    import "wspfwext.idl";  // you add this line

    The build process produces other files, such as wspfwext.h and wspfwext_i.c.

  3. Build the project.
  4. Add include statements.

    The header file wspfwext.h contains the definitions of all necessary filter interface methods (IFWXFilter, IFWXSessionFilter, and so on). Add an include statement for wspfwext.h to the precompiled header file stdafx.h:

    #include "wspfwext.h"

    The MIDL-generated file wspfwext_i.c contains predefined GUIDs for the filter interfaces. Include it in one of the .cpp files, for example SMTPFLTR.cpp.

    #include "wspfwext_i.c"