Article View: borland.public.cppbuilder.nativeapi
Article #7845Re: Visual Form in a service Application?
From: Remy Lebeau (TeamB)
Date: Thu, 16 Dec 2004 18:24
Date: Thu, 16 Dec 2004 18:24
39 lines
2668 bytes
2668 bytes
"Mark Buchert" <MBuchert@bellsouth.net> wrote in message news:41c1a19e@newsgroups.borland.com... > Is it possible to create a visual form in a service application Yes and no. A service can technically display a visual window, but it requires a bit of additional code to set up the environment first before visual windows will work properly. However, VCL forms do not work properly from outside the main thread, but services are run in worker threads instead. You would have to use the service thread's Synchronize() method to make the form be handled by the main thread. I do not recommend using anything other than simple message boxes inside a service. The MessageBox() function has a special flag specifically for services to use to ensure that the dialog box works correctly. > do I need to create a separate GUI application that communicates > with the service? I highly suggest this approach. > My service will be running on a dedicated machine controlling and > monitoring a number of different pieces of equipment. Control can be > either local or remote via a mating Workstation appl. A small form > indicating the status of each would be beneficial for a quick visual > inspection by the maintaince crew, typically not computer savy. Let your workstation app handle that display. You can have it running locally on the same machine as the service. > I realize they would have to login to get the visual Yes. Although another approach would be to write your own screensaver that displays the same information as well. That would be displayed whether a user is logged in or not. Gambit
Technical Details
Message-ID:
<41c1d2ca$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41c1a19e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,94fa92a8800201 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <41c1a19e@newsgroups.borland.com> Subject: Re: Visual Form in a service Application? Date: Thu, 16 Dec 2004 10:24:46 -0800 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41c1d2ca$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103221450 68.69.17.41 (16 Dec 2004 10:24:10 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail