Click here to Skip to main content
15,892,768 members
Articles / Desktop Programming / ATL

Simulate COM Connection Points from a .NET Library

Rate me:
Please Sign up or sign in to vote.
4.91/5 (25 votes)
8 Mar 2006CPOL14 min read 63.4K   1.4K   36  
An article on accessing a VB.NET library from a MFC/ATL COM client.
<?xml version="1.0" encoding="utf-8"?>
<exceptionHandlingConfiguration>
  <xmlSerializerSection type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null">
    <enterpriseLibrary.exceptionHandlingSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/exceptionhandling">
      <exceptionPolicies>
        <exceptionPolicy name="Server Suite Policy">
          <exceptionTypes>
            <exceptionType name="ConfigurationException" type="System.Configuration.ConfigurationException, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="Exception" type="System.Exception, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="InvalidOperationException" type="System.InvalidOperationException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="IOException" type="System.IO.IOException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="SecurityException" type="System.Security.SecurityException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
                <exceptionHandler xsi:type="WrapHandlerData" name="Wrap Handler" exceptionMessage="Server Security Error" wrapExceptionTypeName="System.UnauthorizedAccessException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="SocketException" type="System.Net.Sockets.SocketException, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="SqlException" type="System.Data.SqlClient.SqlException, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
                <exceptionHandler xsi:type="WrapHandlerData" name="Wrap Handler" exceptionMessage="Error Accessing Database" wrapExceptionTypeName="System.Data.DataException, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="SynchronizationLockException" type="System.Threading.SynchronizationLockException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="0" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="TGException" type="TG.Base.TGException, TGLib, Version=1.0.1954.22282, Culture=neutral, PublicKeyToken=null" postHandlingAction="None">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
              </exceptionHandlers>
            </exceptionType>
            <exceptionType name="ThreadAbortException" type="System.Threading.ThreadAbortException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
              <exceptionHandlers />
            </exceptionType>
            <exceptionType name="ThreadInterruptedException" type="System.Threading.ThreadInterruptedException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
              <exceptionHandlers>
                <exceptionHandler xsi:type="LoggingExceptionHandlerData" name="Logging Handler" defaultLogCategory="Exception" defaultEventID="100" defaultSeverity="Error" defaultTitle="Enterprise Library Exception Handling" formatterTypeName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" minimumPriority="5" />
              </exceptionHandlers>
            </exceptionType>
          </exceptionTypes>
        </exceptionPolicy>
      </exceptionPolicies>
    </enterpriseLibrary.exceptionHandlingSettings>
  </xmlSerializerSection>
</exceptionHandlingConfiguration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder SpreadTrends.com
United States United States
I've authored many articles that tackle real-world issues to save my peers in the development community valuable time. For example I've written articles that: show how to decode Ogg Vorbis audio files using the .NET Framework; describe best practices for Improving Entity Framework performance; and demonstrate step-by-step how to create a multi-player game.

Comments and Discussions