473,424 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,424 software developers and data experts.

Windows service. Showing a dialog box

I've written a Windows Service application that monitors input through a com
port.
It's been requested that I add a dialog box so that, should anyone need to
watch the input for troubleshooting reasons, they can.
I remember that I had to call a version of the MessageBox() function that
uses MessageBoxOptions = "ServiceNotification" on one occasion because it
was being called in context of a service application.
Are there any special procedures I have to follow for showing a user defined
dialog from a service?
Nov 17 '05 #1
1 4959
Claire,

Generally speaking, this is a VERY bad idea. Performing UI operations
from a service is very bad practice. The reason for this is that you can
not guarantee that a service will actually have an interactive user session
to show the messagebox to.

If anything, you should have some way of communicating with the service.
The easiest way to do that is to expose an object through remoting. Then,
you can have an agent that runs on another machine (or the same machine),
which can connect to the service through remoting, and be notified when
necessary. The agent would then show the UI.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Claire" <cz*********@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I've written a Windows Service application that monitors input through a
com port.
It's been requested that I add a dialog box so that, should anyone need to
watch the input for troubleshooting reasons, they can.
I remember that I had to call a version of the MessageBox() function that
uses MessageBoxOptions = "ServiceNotification" on one occasion because it
was being called in context of a service application.
Are there any special procedures I have to follow for showing a user
defined dialog from a service?

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
6
by: Microsoft | last post by:
I'm new to CSharp, previously having done all my development in Delphi. I need to create a service, and for the development cycle I wish it to be an interactive service and use message boxes to...
0
by: pithhelmet | last post by:
Hello everyone - I need to create a windows service that will watch for a specific dialog, and when found, send a keypress to the dialog. I have the service working, but when it tries to find...
1
by: Hank | last post by:
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...
5
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the...
2
by: Jeffrey Tate via DotNetMonster.com | last post by:
The error is: The proxy settings on this computer are not configured correctly for Web discovery. MSDN states that this is caused by: This error appears in the Add Web Reference dialog box if...
2
by: monishch | last post by:
Hi!, I am developing a windows service using vb.net in VB 2005.Through the service I am trying to run a exe.While starting service I am getting the following error: ...
0
balabaster
by: balabaster | last post by:
Hi, I know this question has been answered before (somewhat) but I have a twist... I've written a client/server application where the server portion runs as a windows service and allows...
5
by: Stefano Tonello | last post by:
Hi all, I need to call windows' "open with" dialog from my C# windows form application. After the user selects application, control must return to me (I have to launch directly the process). I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.