Partager via


Building an IIS ADSI Extension

This topic describes the steps taken to begin building an IIS ADSI extension.

To support early binding in your extension, you must first add support for aggregation. To do this, you need to do the following:

  1. Create a new ATL (Active Template Library) project.

  2. Create a new ATL class that supports aggregation, and with an interface of type dual.

Set up the project environment to include the library modules activeds.lib and adsiid.lib. Edit the header file stdafx.h. Find the line of code that reads

#include <atlcom.h>

and insert the following two lines of code immediately after:

#include <activeds.h>   
#include <Iads.h>   

Create a new method and add the method implementation information. For any class type that a provider supports, you can provide an extension. To register the extension, add your COM object's CLSID as a subkey of the class name.

Then for each interface that you want to add to the object you are extending, you add the Interface ID as a MULTI_SZ under the key you created.

Note

The type library from all extensions will not be merged, so the ADSI client must specifically include the type libraries for each extension. The type library is needed for Visual Basic? to enable early bindings. C and C++ can use the QueryInterface method to directly query the extension interfaces defined in the extension's header files.