How to invoke .net components from com components,give the
sequence ?

Answer Posted / shyam

When a COM client calls a .NET object, the common language
runtime creates the managed object and a COM callable
wrapper (CCW) for the object. Unable to reference a .NET
object directly, COM clients use the CCW as a proxy for the
managed object.

The runtime creates exactly one CCW for a managed object,
regardless of the number of COM clients requesting its
services. As the following illustration shows, multiple COM
clients can hold a reference to the CCW that exposes the
INew interface. The CCW, in turn, holds a single reference
to the managed object that implements the interface and is
garbage collected. Both COM and .NET clients can make
requests on the same managed object simultaneously.

COM callable wrappers are invisible to other classes
running within the .NET Framework. Their primary purpose is
to marshal calls between managed and unmanaged code;
however, CCWs also manage the object identity and object
lifetime of the managed objects they wrap.

Object Identity

The runtime allocates memory for the .NET object from its
garbage-collected heap, which enables the runtime to move
the object around in memory as necessary. In contrast, the
runtime allocates memory for the CCW from a noncollected
heap, making it possible for COM clients to reference the
wrapper directly.

Object Lifetime

Unlike the .NET client it wraps, the CCW is reference-
counted in traditional COM fashion. When the reference
count on the CCW reaches zero, the wrapper releases its
reference on the managed object. A managed object with no
remaining references is collected during the next garbage-
collection cycle.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the relational database of tables and forms

1949


Explain the use of contextutil class?

3221


Explain how to make a net component talk to a com component?

3188


Explain disadvantages of com components?

522


Explain how to register com+ services?

3300






What are rcw?

501


Explain the new three features of com+ services, which are not there in com (mts)?

3354


Define durability?

461


Why we learn the 8085? Because we are in 21 century so why we learn 8085?

411


What is integrity?

517


Explain how to register dll in com / com+ application?

3224


Is the com architecture same as .net architecture?

3118


How CCW and RCW is working?

678


Is it true that COM objects no longer need to be registered on the server?

529


What is jit activation?

511