Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

COM Interop

From Wikipedia, the free encyclopedia
Type of technology included in the .NET Framework

COM Interop is a technology included in the.NET FrameworkCommon Language Runtime (CLR) that enablesComponent Object Model (COM) objects to interact with .NET objects, andvice versa.[1][2][3]

COM Interop aims to provide access to the existing COM components without requiring that the original component be modified. It tries to make the .NET types equivalent to the COM types. In addition, COM Interop allows COM developers to access managed objects as easily as they access other COM objects.

Interop tools

[edit]

Tools to support a COM component using a .NET assembly

[edit]

The.NET Framework creates a type library and special registry entries when a component is registered. It provides a specialized utility (RegAsm.exe, usually located inC:\Windows\Microsoft.NET\Framework) that exports the managed types into a type library and registers the managed component as a traditional COM component. When the type is instantiated through COM, the .NETCLR is the actual COM object that executes, and it merely marshals any method calls or property access to the type implementation.

Registration-free COM can be used to avoidDLL hell.

Tools to support a .NET assembly using a COM component

[edit]

A COM Interop for an existing COM component can be created through the use of theTlbimp.exe tool supplied with the .NET Framework SDK. This tool will create a set of proxy classes implemented inCIL which is encapsulated in anassembly.

Details

[edit]

COM interop automatically provides the following services to simplify COM usage from .NET:

  • Conversion between COM types and equivalent .NET types.
  • Translation ofretval arguments into return values.
  • Translation of HRESULT return values into exceptions.

References

[edit]
  1. ^Kaplan, J.; Dunn, R. (2006).The .NET Developer's Guide to Directory Services Programming. Microsoft Windows Development Series. Pearson Education. p. 217.ISBN 978-0-13-270146-4. Retrieved2025-03-05.
  2. ^Gordon, A. (2003).The .NET and COM Interoperability Handbook. Integrated .NET series from Object Innovations and Prentice Hall PTR. Prentice Hall PTR. p. 286.ISBN 978-0-13-046130-8. Retrieved2025-03-05.
  3. ^Troelsen, A. (2010).Pro C# 2010 and the .NET 4 Platform. Books for professionals by professionals. Apress. p. 717.ISBN 978-1-4302-2550-8. Retrieved2025-03-05.

External links

[edit]
Implementations
Architecture
Components
Tools
Decompilers
Obfuscators
IDEs
Organizations
Stub icon

This article about software created, produced or developed byMicrosoft is astub. You can help Wikipedia byadding missing information.

Retrieved from "https://en.wikipedia.org/w/index.php?title=COM_Interop&oldid=1278893834"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp