Microsoft Internet Security and Acceleration Server 2004 SDK

Using ISA Server 2000 and ISA Server 2004 COM Objects Together

ISA Server 2004 has new administration COM objects that are not compatible with the ISA Server 2000 administration COM objects. Some of the ISA Server 2004 administration COM objects have the same names as ISA Server 2004 COM objects, but they have different class identifiers (CLSIDs). Attempting to use ISA Server 2004 and ISA Server 2000 COM objects with the same name in a single application can result in compilation errors due to name collisions.

If you need to build a single C++ application that supports using both the ISA Server 2004 administration COM objects and the ISA Server 2000 administration COM objects, you can avoid name collisions by using the rename_namespace attribute of the #import directive to rename the namespace of the ISA Server 2004 interfaces when you include the Microsoft Internet Security and Acceleration Server 2004 Administration Library (Msfpccom.dll) in your application.

By using the rename_namespace attribute, you can instruct Visual C++ to generate the classes declared in the ISA Server 2004 .idl file under a namespace that differs from the one specified in the library itself. This way, even if the names of ISA Server 2000 and ISA Server 2004 interfaces are the same you can avoid the resulting name collisions.

The following code instructs Visual C++ to include the file Msfpccom.dll and to change the namespace for the ISA Server 2004 interfaces to FPC2004:

#import "%SystemDrive%\Program Files\Microsoft ISA Server 2004\msfpccom.dll" 
		rename_namespace("FPC2004")

Then when using ISA Server 2004 interfaces in your code, you will need to qualify them with FPC2004.