Re: Windows Service Launching C# App

From: Brad Jones (brad_at_uicnospam.com)
Date: 03/11/05


Date: Fri, 11 Mar 2005 10:31:03 -0500

Hi Joshua, thanks for the response.

These applications do not need to be invoked independent of the service,
although they can be. Our equipment populates circuit boards with
components, and most of the applications handle various conditions and
situations that can occur requiring user intervention to resolve. So, in
essence, the applications act like services with GUI's.

A customer typically starts the production run and logs out for security
reasons. Many times another user will log in with reduced privileges but the
machine continues to run during any logouts. Since, as you know, services
don't readily support a GUI, the method I described earlier is how we get
around that. All applications started by the master service
(CreateProcess()/CreateProcessAsUser()) remain running until machine/windows
shutdown. We display dialogs, handle windows messages, and even access the
network if needed (using a predefined account) without anyone logged in.
There are lights on the equipment which alert the user to any problems. BTW
we are running Win2k Pro.

I guess I'm looking for an equivalent method (again...hack?) to keep the C#
app running during a logoff. Maybe one doesn't exist. Rearchitecting is not
really an option at this point. I'd sooner be forced to do a rewrite in C++.

I don't know if any of that information is helpful, but thanks again for
taking the time to respond.

"Joshua Flanagan" <josh@msnews.com> wrote in message
news:eZffHQdJFHA.3340@TK2MSFTNGP12.phx.gbl...
>I assume you need the functionality to be usable from both a GUI and a
> service.
> Is there a reason why you can't factor out the common code into a
> separate library, and then call it from the service and the GUI?
>
>
> Brad Jones wrote:
>> Hello, I'm hoping someone can give me some help or guidance here. I'm not
>> sure if this is even the best group to post to for this.
>>
>> Our OEM equipment's software architecture relies heavily on a "master"
>> windows service. This responsibility of this service is to launch 10 or
>> so
>> other applications, some of which have GUI's. These applications need to
>> be
>> running whether somebody is logged in or not. There is no communication
>> required between the master service and the individual applications. An
>> external configuration file is read by the master service when it starts,
>> telling it which applications to launch and what other behavior is
>> desired.
>> So, when a newly developed application requires that it be running when
>> nobody is logged in, information is simply added to the configuration
>> file
>> and we're done. Currently, all of these applications are C++/MFC and the
>> trick (hack?) used to keep these applications running when a user logoff
>> occurs is related to http://support.microsoft.com/kb/q164166/ . This has
>> been working well for several years.
>>
>> Now to my question. I recently completed development on a GUI C#
>> application
>> which I would like to run in the same manner as described above.
>> Everything
>> starts up fine, but my C# application does not survive the logoff, and in
>> some cases interferes with it. Is there a way to get past this or should
>> I
>> start looking for another solution (like rewrite it in C++). Hope this
>> makes
>> sense to somebody and thanks in advance for any advice.
>>
>>
>> Brad Jones (Not CoduGuru guy!)
>>
>>



Relevant Pages

  • Re: BPIs: The Simplest GUIs
    ... by writing GUI programs as simple servers communicating with the ... See also AWS for a little web server designed ... A Windows HTML applications. ... C Various desktop gadget technologies (Konqueror/Yahoo, Windows Vista gadgets, ...
    (comp.programming)
  • Re: Windows Service Launching C# App
    ... and then call it from the service and the GUI? ... > other applications, ... information is simply added to the configuration file ... > trick used to keep these applications running when a user logoff ...
    (microsoft.public.dotnet.general)
  • Re: CBH file-format spec and the need for a new database program?
    ... I thought you wanted a world-class GUI? ... Well those applications have a much nicer interface than ChessBase 9 ... C/C++ has hardly any type system worth speaking of, ... this respect and has a type system much closer to something like Java. ...
    (rec.games.chess.computer)
  • Re: Windows Service Launching C# App
    ... immediate problem. ... the separate GUI client). ... > These applications do not need to be invoked independent of the service, ...
    (microsoft.public.dotnet.general)
  • Examples of great interface design in Access2003?
    ... feature great interface (ie GUI) design? ... not too bad at GUI design, but I'm not necessarily all that innovative, ... I've already downloaded and checked out the 'template' applications ... Microsoft Office template applications is freely available for download ...
    (comp.databases.ms-access)