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

Answer Posted / shyam

The common language runtime exposes COM objects through a
proxy called the runtime callable wrapper (RCW). Although
the RCW appears to be an ordinary object to .NET clients,
its primary function is to marshal calls between a .NET
client and a COM object.

The runtime creates exactly one RCW for each COM object,
regardless of the number of references that exist on that
object. As the following illustration shows, any number of
managed clients can hold a reference to the COM objects
that expose INew and INewer interfaces. The runtime
maintains a single RCW for each object.

Using metadata derived from a type library, the runtime
creates both the COM object being called and a wrapper for
that object. Each RCW maintains a cache of interface
pointers on the COM object it wraps and releases its
reference on the COM object when the RCW is no longer
needed. The runtime performs garbage collection on the RCW.

Among other activities, the RCW marshals data between
managed and unmanaged code, on behalf of the wrapped
object. Specifically, the RCW provides marshaling for
method arguments and method return values whenever the
client and server have different representations of the
data passed between them.

The standard wrapper enforces built-in marshaling rules.
For example, when a .NET client passes a String type as
part of an argument to a managed object, the wrapper
converts the string to a BSTR type. Should the COM object
return a BSTR to its managed caller, the caller receives a
string. Both the client and the server send and receive
data that is familiar to them. Other types require no
conversion. For instance, a standard wrapper will always
pass a 4-byte integer between managed and unmanaged code
without converting the type.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to register com+ services?

3306


What is integrity?

518


Explain the disadvantages of com components?

2779


What are loosely coupled events?

2870


What is jit activation?

511






What is scalability?

493


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

412


Define durability?

463


What is durability?

545


How CCW and RCW is working?

681


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

3356


What are Interop Services?

550


What is ccw?

3199


How to make a net component talk to a com component?

460


What is security?

3257