Does .NET uses the RCW when using .NET componet with COM Interop enabled?

Does .NET uses the RCW when using .NET componet with COM Interop enabled?

Post by Patrici » Wed, 12 Jun 2002 07:00:18



Hello all, we are developing a component in C# and we enabled the COM
Interop feature to access the component from COM clients.

If we use this component from .NET (managed code), does .NET calls the
component using the RCW (runtime-callable wrapper)? or it uses the .NET
interface directly?  We are afraid that the enabling of the COM Interop may
introduce an overhead when using the component from .NET.

Thank you in advance for you answers.

Patricio.

 
 
 

Does .NET uses the RCW when using .NET componet with COM Interop enabled?

Post by Mattias Sj?gre » Wed, 12 Jun 2002 07:22:14


Patricio,

Quote:>If we use this component from .NET (managed code), does .NET calls the
>component using the RCW (runtime-callable wrapper)? or it uses the .NET
>interface directly?

It uses the .NET interface directly. There's no overhead just because
the component is COM interop enabled.

Mattias

===
Mattias Sj?gren (VB MVP)

http://www.msjogren.net/dotnet/

 
 
 

Does .NET uses the RCW when using .NET componet with COM Interop enabled?

Post by Patrici » Wed, 12 Jun 2002 08:26:49


Mattias, thank you for your answer.  It was what I hoped.

Do you have a link to that information at the Microsoft site?
I would like to have it as supporting documentation for our
project.

Thank you again.
Patricio.


> Patricio,

> >If we use this component from .NET (managed code), does .NET calls the
> >component using the RCW (runtime-callable wrapper)? or it uses the .NET
> >interface directly?

> It uses the .NET interface directly. There's no overhead just because
> the component is COM interop enabled.

> Mattias

> ===
> Mattias Sj?gren (VB MVP)

> http://www.msjogren.net/dotnet/

 
 
 

Does .NET uses the RCW when using .NET componet with COM Interop enabled?

Post by Mattias Sj?gre » Thu, 13 Jun 2002 05:14:53


Patricio,

Quote:>Do you have a link to that information at the Microsoft site?
>I would like to have it as supporting documentation for our
>project.

No sorry, I can't remember seeing it explicitly spelled out anywhere
in the documentation.

Mattias

===
Mattias Sj?gren (VB MVP)

 
 
 

1. .NET using COM using .NET

Hi All

We are in the process of migrating our application to .NET
but due to time constraints we can only part the core
components and need to make use of COM interop to re-use
the remainder of the components.  As a result we have
situations we're a .NET component uses a COM component and
this COM component again uses another .NET component.  
This all seems work fine except for when making changes to
the a .NET component that is used by any of the COM
components.  As soon as I make a change to a .NET
component, I get a type mismatch error when trying to
instantiate the COM component through its Interop
Assembly.  

I assumed that the Interop Assembly was "now out of date"
and I therefore used tlbimp to create new Interops for all
the COM components.  However, when I use tlbimp I now get
errors stating the some of the .NET interfaces used by the
component is not valid anymore.  The only way to resolve
this problem is then to recompile all the COM components
that make use of the .NET components and then recreate all
the Interop Assemblies for these components.  After all of
this, everything then seems to be working fine.

Why is it that everytime that I recompile my .NET
components, the COM components that make use of these
components "go out of sync"??  I flag the .NET components
with the PrimaryInteropAssembly attribute and I do not
change any of the public interfaces defined by these
components as well.  They all have static version numbers
so it is not as if they get new version numbers when they
are compiled.  All the .NET components also have the Guid
specified in their Assemblies so that it will recreate the
same GUID for the type library every time they are
compiled? Is there such a thing as breaking binary
compatibility in the .NET component when I recompile it
which causes the COM component to go out of sync.  What
changes in the type library for the .NET component
everytime that I recompile it that would cause this to
happen?  So many questions - I desparately need some
answers ;-)

Thanks
Carel

2. Fractal dimension in Matlab code

3. marshal-by-value COM objects loose marshal-by-value semantics through .NET interop (RCW)

4. mutt-0.95i dotlocking

5. Using Interop with the COM IStorage interface, using StgOpenStorage and using IPropertySetStorage.Open

6. Oki microline 172 driver

7. Com consumers of .net componets in .net release

8. Problems with Epson Action Laser 1500

9. deploying and registering com.dll's used with .NET interop

10. Using Threads from .Net COM Interop class

11. ASP COM object using Interop -> which GC is used?

12. .NET client using COM+ Proxy created using .NET

13. Exception: COM object that has been separated from its underlying RCW can not be used.