[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

Windows Form in Windows Service

Marc Gritter

6/15/2004 11:08:00 AM

Hi there,

I've written an Windows Service. In this service I've declared a windows
form. I'm trying to open that form by using remoting. I can access the form,
but when I call the .showdialog routine I got the following error message:

It is invalid to show a modal dialog or form when the application is not
running in UserInteractive mode. Specify the ServiceNotification or
DefaultDesktopOnly style to display a notification from a service
application.

Does anyone know how to solve this problem?

Thanks in advance

Marc.


2 Answers

Sunny

6/15/2004 2:04:00 PM

0

Hi, your question has nothing to do with remoting ... but, it will :

Windows services do not need a logged user to run. So by default they do
not have user interface, as there is no desktop/console where to output.
There is a setting in the services configuration snap-in, where you can
enable interaction with desktop.

But this is not the recommended way.

So, now for remoting:

Make your service to expose some controlling methods via remoting. Then
create a normal windows forms remoting client, which connects to the
service and manipulates it.

Sunny


In article <Orx6WksUEHA.1356@TK2MSFTNGP09.phx.gbl>, m.gritter@awl.nl
says...
> Hi there,
>
> I''ve written an Windows Service. In this service I''ve declared a windows
> form. I''m trying to open that form by using remoting. I can access the form,
> but when I call the .showdialog routine I got the following error message:
>
> It is invalid to show a modal dialog or form when the application is not
> running in UserInteractive mode. Specify the ServiceNotification or
> DefaultDesktopOnly style to display a notification from a service
> application.
>
> Does anyone know how to solve this problem?
>
> Thanks in advance
>
> Marc.
>
>
>

Marc Gritter

6/16/2004 6:30:00 AM

0

Thanks, I think I''ve solved my problem now.

"Sunny" <sunnyask@icebergwireless.com> wrote in message
news:%23oNdkGuUEHA.2360@TK2MSFTNGP10.phx.gbl...
> Hi, your question has nothing to do with remoting ... but, it will :
>
> Windows services do not need a logged user to run. So by default they do
> not have user interface, as there is no desktop/console where to output.
> There is a setting in the services configuration snap-in, where you can
> enable interaction with desktop.
>
> But this is not the recommended way.
>
> So, now for remoting:
>
> Make your service to expose some controlling methods via remoting. Then
> create a normal windows forms remoting client, which connects to the
> service and manipulates it.
>
> Sunny
>
>
> In article <Orx6WksUEHA.1356@TK2MSFTNGP09.phx.gbl>, m.gritter@awl.nl
> says...
> > Hi there,
> >
> > I''ve written an Windows Service. In this service I''ve declared a windows
> > form. I''m trying to open that form by using remoting. I can access the
form,
> > but when I call the .showdialog routine I got the following error
message:
> >
> > It is invalid to show a modal dialog or form when the application is not
> > running in UserInteractive mode. Specify the ServiceNotification or
> > DefaultDesktopOnly style to display a notification from a service
> > application.
> >
> > Does anyone know how to solve this problem?
> >
> > Thanks in advance
> >
> > Marc.
> >
> >
> >