Com Interop

From RemObjects Software

Jump to: navigation, search

This is a Technical Glossary entry
Feel free to add your notes to this topic below.


.NET supports several ways to interop with COM.

Using .NET libraries as COM objects

Using a .NET library as a COM object is simple. It requires a few things from your libraries:

  • [assembly:ComVisible (true)] << the COM Visible attribute has to be set on the assembly level for a library to be usable as COM
  • Classes and methods have to be public and non-generic

a .NET library has to be registered with Regasm.exe to be used from COM. The regasm tool can export a TLB that can be used from a COM capable language.

Using COM libraries from .NET

Using Oxygene, you can use the References node in your solution to add references to COM objects. Right click the node and select Add Reference, on the COM tab you can select a COM object to import. Another option is using the TLBIMP tool, included with the .NET SDK to generate a COM library manually.

Personal tools