COM Interop with Notification Services
All Notification Services APIs are developed in managed code. However, many Notification Services classes have been developed to be used from unmanaged code as well through COM interop. If you are integrating Notification Services into an existing unmanaged application, you probably need to continue to use unmanaged code for your subscription management interface. The COM interop solution is provided for this purpose.
Namespaces That Do Not Support COM Interop
The classes in the following Notification Services namespaces do not support COM interop:
- Microsoft.SqlServer.NotificationServices.Rules, which is used in subscription management interfaces that support condition-based subscriptions. This namespace is in the
Microsoft.SqlServer.NotificationServices.Rules.dll
assembly. - Microsoft.SqlServer.Management.Nmo, which you can use to programmatically define Notification Services applications and to configure, deploy, and manage Notification Services instances. This namespace is in the
Microsoft.SqlServer.Smo.dll
assembly.
Microsoft.SqlServer.NotificationServices Namespace
The following classes in the Microsoft.SqlServer.NotificationServices namespace have at least partial support for COM interop:
-
Note
The Condition property does not support COM interop.
These classes provide a default constructor and an Initialize method for creating and initializing an object in unmanaged code. For overloaded methods in these classes, the most extensive overload is provided to the COM caller, and method parameters are made optional in order to provide equivalent functionality.
If you have installed multiple versions of Notification Services, and are using COM interop, your code uses the APIs from the most recently installed version of Notification Services. This is not necessarily the highest version number of Notification Services. Such a discrepancy can occur because the Program ID (under HKEY_CLASSES_ROOT) is of the form "Microsoft.SqlServer.NotificationServices.NSInstance", and always points to the most recently installed version.
For more information about using COM interop, refer to COM Interoperability in Visual Basic and Visual C# in the Microsoft MSDNĀ® Library.
See Also
Concepts
Notification Services Architecture
Notification Services Programming Framework
Notification Services Deployment Options
Other Resources
Building Notification Solutions
Deploying Notification Services
Administering Notification Services