To support early binding in your extension, you must first add support for aggregation. To do this, you will need to do the following:
Set up the project environment to include the library modules activeds.lib and adsiid.lib. It will be necessary to 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 it.
#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 directly QueryInterface the extension interfaces defined in the extension’s header files.