Making .NET and COM Components Work Together

Making .NET and COM Components Work Together

Previous chapters have discussed issues regarding COM interop and how best to handle it in your applications. Although these discussions were directed at standard COM components, much of the information also applies to using COM+ applications from .NET. It is possible to import server, library, and proxy applications into your Visual Basic .NET projects. The imported objects are used just as they are in any other COM interop scenario. In addition, if your application has a ServicedComponent class that calls into the imported COM+ application, the context will propagate transparently across the interop boundary. You need to take into account some special considerations if you intend for your .NET serviced components to work with COM clients:

  • Avoid using parameterized constructors.

  • Avoid using static methods.

  • Define event-source interfaces in managed code.

  • Include HRESULTs in user-defined exceptions.

  • Supply GUIDs for types that require them.

  • Expect inheritance differences.



Upgrading Microsoft Visual Basic 6.0to Microsoft Visual Basic  .NET
Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET w/accompanying CD-ROM
ISBN: 073561587X
EAN: 2147483647
Year: 2001
Pages: 179

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net