Can you marshal a Form across computers?

  • Thread starter Thread starter Aaron Stibich
  • Start date Start date
A

Aaron Stibich

I would like my server on computer A to serve up a System.Windows.Forms.Form
object to a client application on computer B. Is that possible?

I tried the following test. I implemented the following interface on my
server

public interface IMyInterface
{
void CreateNewForm( out Form newForm );
}

The server implementation looks like this

public void CreateNewForm( out Form newForm )
{
newForm = new MyForm();
}

Then in the remote client I wrote

Form fp;
theserver->CreateNewForm( out fp );
fp.ShowDialog();

Alas, the dialog displays on the server's computer.

Having the server serve up GUI objects (not just HTML) is a holy grail of
mine. It would allow us to completely control the UI from the server layer,
making our application just a vessel for displaying windows forms - about as
thin as it gets.
 
Aaron,
The basic problem as I see it in what you are attempting.

Is that Form, more specifically Control, ultimately inherits from
MarshalByRefObject.

To get this to work, won't you need to have each control on your form be
serialized to the client, so the client actually has the object, not a
reference to the object on the server?

Of course I have not done a lot of .NET Remoting, so I may be wrong.

Hope this helps
Jay
 
Have you looked at no touch deployment ?
Forms get downloaded in IE's download cache and then run from there. Change
the Dll on the server and new version automatically gets downloaded with
nothing to do. Like an HTML page. What you are attempting would probably
never work since you would still need the dll on the client to actually be
able to run the form once it gets de-serialized...

Put your exe and related dll's on your web server in the same directory and
just browse to your exe click and run. That's as complicated as it needs to
be.

Chris.
 
Back
Top