Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / June 2004

Tip: Looking for answers? Try searching our database.

Passing dot net objref via COM?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Larry Heller - 23 Jun 2004 01:30 GMT
[Sorry for cross-posting, but this topic equally relates to remoting and
interop!]

I am extending a legacy app which uses DCOM to implement a networked
client-server architecture. As some more recent parts of the app are written
in .NET, I would like to use it for my new extensions. I have been
successful in building a .NET remoting sample, so I have an inkling how it
works.

Anyway, what I want to do is to is to pass a reference to a remoteable .NET
object from one AppDomain to another via a COM client-server infrastructure
which is already in place. In other words, I want to create a remoteable
.NET object on the server and return a (CCW) interface pointer to a COM
object on the server. This CCW interface is returned to a COM client on the
client machine via DCOM. Now I want to pass the CCW COM interface to a .NET
object on the CLIENT machine and get back a .NET reference to the .NET
server object running on the server machine.

Can this be done? If so, how? A tiny sample or code snippets would be
extremely helpful and very much appreciated.
Jim Sievert - 23 Jun 2004 14:17 GMT
If I understand your question correctly, your work is done.  A CCW is
already an MBRO.  You can pass it directly into .Net code on the client.  As
long as you have an assembly on the client that represents the interfaces
implemented by the target object on the server, all you need on the client
is a simple cast!

> [Sorry for cross-posting, but this topic equally relates to remoting and
> interop!]
[quoted text clipped - 16 lines]
> Can this be done? If so, how? A tiny sample or code snippets would be
> extremely helpful and very much appreciated.
Larry Heller - 23 Jun 2004 17:08 GMT
Sorry for my ignorance... what is an MBRO?

> If I understand your question correctly, your work is done.  A CCW is
> already an MBRO.  You can pass it directly into .Net code on the client.  As
[quoted text clipped - 27 lines]
> > Can this be done? If so, how? A tiny sample or code snippets would be
> > extremely helpful and very much appreciated.
Sunny - 23 Jun 2004 17:20 GMT
MBRO = MarshalByReferenceObject

All objects passed thru remoting have to be MBRO or marked as
ISerializable.

MBRO as the name shows are passed as a reference, while ISerializable
objects are passed by value.

Sunny

> Sorry for my ignorance... what is an MBRO?
>
[quoted text clipped - 31 lines]
> > > Can this be done? If so, how? A tiny sample or code snippets would be
> > > extremely helpful and very much appreciated.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.