简体   繁体   中英

COM Interop .NET Assembly - A Terminology Question

My question is only about terminology. Does "COM Interop" refer only to using a COM component or object inside a .NET project?

What term is best used for the practice of making a .NET Assembly and designing and configuring it for use in COM applications (such as VB6 or VBA)?

COM Object :

Component Object Model (COM) is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages. The term COM is often used in the Microsoft software development industry as an umbrella term that encompasses the OLE, OLE Automation, ActiveX, COM+ and DCOM technologies.

So a COM object isn't language dependent. It's a communication protocol.
So anything that uses this protocol is a COM Object.

You can create dlls that support COM Communication using .NET Framework.

A COM Interop is the interface .NET uses to wrap the COM Communication so you can write regular .NET code without having to mess with COM protocol and declarations. Visual Studio can create Interops when you reference COM objects to the project.

COM Interop is a technology included in the .NET CLR that enables COM objects to interact with .NET objects, and vice versa.

Such classes are often referred to as CCWs COM-callable wrappers.
COM Interop means both: Using COM from .Net and using .Net via COM.

COM interop is usually referred to the .NET binding assembly to a COM DLL. For example when you add a reference to a COM DLL in a .NET project and it is created.

From what I know, COM Interop would be using either COM from .NET or the other way around.

Now you have two options to make your .NET assembly COM Visible See this:
"Register for COM Interop" vs "Make assembly COM visible"

When you want to use a COM Library Visual Studio will use Tblimp.exe and generate a interop assembly which can be used within .NET. For the process the other way around there is Tblexp.exe

This somewhat old article covers quite a bit about COM Interop in .NET. (Note, it talks about Iterop both ways)

Do remember .NET4 has some nice new features to use COM from .NET.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM