HELP: expose Windows dialog from Windows Service

  • Thread starter Thread starter Hank
  • Start date Start date
H

Hank

I am writing a windows service in C#.NET which will manage image capturing
devices, when client connects to the service, at some point the service need
to expose a device dialog to the client for setting some device specific
parameters. According to MSDN docs, classes within the Windows Forms
namespace are not supported for use within a Windows service. So How can I
do that?
Thanks!
HELP: expose Windows dialog from Windows Service
 
Hank,

There is a quick and dirty way, and there is the right way.

If you want, you can mark a service as being able to interact with the
desktop. This is an option on the service that you have to check off. If
you use that, you should be able to use classes from the Windows Forms
namespace in your service.

However, this is the absolutely wrong way to do it.

You said that you have clients that are accessing the service. The
client should use remoting (or some other message/distributed object
technology/method) to make a request to the service and get a response back.
If you need to show a dialog, then the response should indicate what that
you need to show something, and the client will be responsible for showing
that to the user.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top