I have a question about how classes and structs are marshalled thru COM+
to an appliction.
I have two DLL's. One is a COM+ dll, the other isn't.
Let's assume that I have a class that is COM+ class called TestFactory
that inherits from ServicedComponent and is contained in a dll that has
been registered in COM+. The TestFactory has a method called
LoadEmployee() that creates and returns an Employee object (described
next).
Assume that I have another class called Employee in a different DLL that
is NOT registered in COM+ (the class just inherits from Object).
If a Windows Forms app (or web app for that matter) that calls the
TestFactory.LoadEmployee() method, where is the Employee object that is
returned located? Is it still in the COM+ side of the system or does it
get completely marshalled back to the application?
Also, if the class is still in COM+; would a structure work any
differently?
Thanks for any help,
Bill Davis.
Bill W. Davis - 29 Apr 2004 21:04 GMT
To answer my own question... (as far as I have figured it anyway)
If I'm using a DLL that has COM+ (Enterprise Services) objects in it,
then there isn't any boundary that is crossed. In process calls
(library/dll) don't ever cross a boundary. There is some C++ code that
magically takes care of the COM+ stuff for you.
It's only when you are dealing w/ server applications where this comes
into play. And I believe at that point Enterprise Services relies on
.net remoting. So to get an object that actually "crosses" the
boundary between a server and application (or dll), the object would
need to derive from MarshalByVal.
> I have a question about how classes and structs are marshalled thru COM+
> to an appliction.
[quoted text clipped - 20 lines]
> Thanks for any help,
> Bill Davis.