[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Show form from remotable object?

Robin Prosch via .NET 247

9/6/2004 3:16:00 PM

Hi all,

Is this possible to display a windows form from a remotable object?
I need to create a singlecall server application that gives access to an instance of MapPoint ActiveX control to its clients. And I also would like to display a form from the remotable object containing the ActiveX, so I can see the actual maps being retrieved by the remote clients (for debugging purposes).

In a sense I need to create an Automation-enabled app, so that I can interact with it programmatically or via user interface at the same time. Is this possible with .NET remoting?

Thank you for your input.

Alex

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>HKovllGiZES8Fs6RaJPtYQ==</Id>
4 Answers

Ken Kolda

9/7/2004 9:05:00 PM

0

If you're trying to get your server to show a window on the client with an
ActiveX control in it (and the ActiveX control lives only on the server),
that's not going to happen. Remoting is not a means for transparently
running a UI on a seperate computer (like X Windows is for UNIX). Instead,
you would have to pass from the server to the client sufficient info for the
client to render the map itself (which would require the client have the
ActiveX control installed).

Ken


"Alex Oleynikov via .NET 247" <anonymous@dotnet247.com> wrote in message
news:uAsQyRClEHA.3016@tk2msftngp13.phx.gbl...
Hi all,

Is this possible to display a windows form from a remotable object?
I need to create a singlecall server application that gives access to an
instance of MapPoint ActiveX control to its clients. And I also would like
to display a form from the remotable object containing the ActiveX, so I can
see the actual maps being retrieved by the remote clients (for debugging
purposes).

In a sense I need to create an Automation-enabled app, so that I can
interact with it programmatically or via user interface at the same time. Is
this possible with .NET remoting?

Thank you for your input.

Alex

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>HKovllGiZES8Fs6RaJPtYQ==</Id>


Alex O.

9/22/2004 11:05:00 PM

0

Ken,

Thank you for your response. Sorry for my late follow up - I have not
been able to access this topic's thread thru .NET 247 server since I
posted it! I finally managed to find the thread mirrored on
DevelopersDex server.

OK, let me clarify the issue a little bit.
No, I am not expecting the ActiveX to cross the app domain boundaries
and appear on the client's screen.
What I am looking for is to display the form from the instance of the
remotable object ON THE SERVER'S side.

I need this for debugging purposes to see how client's requests are
being handled (ActiveX has its own user interface, which will display
the progress of operation).

When I create an instance of a form in the remotable object and display
it on the server, I can see the form, but it is "frozen" - no reaction
to local user's actions.

I suspect that the form is not attached to a message loop, and therefore
remains non-responsive.

Is it possible to have windows messages processing on the form launched
from the object, which itself was activated through the remoting?

Thank you.

Alex

*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!

Ken Kolda

9/22/2004 11:26:00 PM

0

If you're displaying the form on the server, you can either:

1) Display it modally from the same thread that is processing the remote
object's method call (which will block the client until the dialog is closed
on the server).
2) Spawn a new thread and display it modally from there.
3) Spawn a new thread and call Application.Run(new MyForm()) to show the
form and start a message loop for it.

I haven't tried any of these but I believe they will work. I think you can
display a modal dialog without explicitly spwaning a message loop (it
creates it own) -- if you go non-modal then you have to start the message
pump yourself.

Hope that helps -
Ken


"Alex O." <aoleynikov@hotmail.com> wrote in message
news:u3whjiPoEHA.2492@TK2MSFTNGP12.phx.gbl...
> Ken,
>
> Thank you for your response. Sorry for my late follow up - I have not
> been able to access this topic's thread thru .NET 247 server since I
> posted it! I finally managed to find the thread mirrored on
> DevelopersDex server.
>
> OK, let me clarify the issue a little bit.
> No, I am not expecting the ActiveX to cross the app domain boundaries
> and appear on the client's screen.
> What I am looking for is to display the form from the instance of the
> remotable object ON THE SERVER'S side.
>
> I need this for debugging purposes to see how client's requests are
> being handled (ActiveX has its own user interface, which will display
> the progress of operation).
>
> When I create an instance of a form in the remotable object and display
> it on the server, I can see the form, but it is "frozen" - no reaction
> to local user's actions.
>
> I suspect that the form is not attached to a message loop, and therefore
> remains non-responsive.
>
> Is it possible to have windows messages processing on the form launched
> from the object, which itself was activated through the remoting?
>
> Thank you.
>
> Alex
>
> *** Sent via Developersdex http://www.develop... ***
> Don't just participate in USENET...get rewarded for it!


Alex O.

9/27/2004 3:44:00 AM

0

Hi Ken,

Thanks for your recommendations.
I have actually solved my problem by moving to CAO activation model and
providing a singleton class factory to return instances of remotable
class. Then I create and show a form from that class instance and it
works like a champ - not even needed to be hooked up with a message
loop.

Basically the steps taken in the host server are:

1.Create instance of the remotable singleton object to act as class
factory.
2.Marshall that object.
3.Class factory object provides a method to create another remotable
object, which then launches the form.


Thank you for your help, Ken.

Alex

*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!