COM Marshalling in .NET

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I have a question regarding the COM marshaling that occurs
between .NET and COM components. I'm on a large project
currently written with VB6/C++/COM, and we are considering
moving to .NET for "peices" of the project. As I
understand it, COM Interop allows .NET and COM to play
together, but all object/parameters passed between .NET
and COM must be marshalled. If objects are marshalled,
then the .NET component will have a COPY of the
object/parameter. Can I be sure that any updates to the
object on either side will get reflected back through the
marshalling interface? And, does anyone have any numbers
regarding performance degredation for this scenario?

Thanks in advance.
 
-----Original Message-----
I have a question regarding the COM marshaling that occurs
between .NET and COM components. I'm on a large project
currently written with VB6/C++/COM, and we are considering
moving to .NET for "peices" of the project. As I
understand it, COM Interop allows .NET and COM to play
together, but all object/parameters passed between .NET
and COM must be marshalled. If objects are marshalled,
then the .NET component will have a COPY of the
object/parameter. Can I be sure that any updates to the
object on either side will get reflected back through the
marshalling interface? And, does anyone have any numbers
regarding performance degredation for this scenario?

Thanks in advance.
.

In VC and VB COMs are automatically marshalled across the
process boundries. But in .Net platform you need to mark
the serilization support to mershel object by reference
and; inherit from MarshelObjectByReference object to
marshel the objects by reference.

Updates to the object will be reflected via the interface.
But you have to optimize your code to minimize the number
of time you change the values of the refernce object.
Because every time when you make a change, their will be a
RPC over the wire to keep the both sides of the object
updated. However it is always a good practice to minimize
the number of objects you pass by reference to a remote
procedure.

Good luck with your piece.
Buddhike de Siva.
Contact: +94 114794911 or (e-mail address removed)
 
Back
Top