🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10123

Re: Stopping a service from within itself

#10123
From: Frank Gruber
Date: Mon, 17 May 2004 09:29
15 lines
1351 bytes
> The best way is to just call the service's Controller() method directly:
>
>     void __fastcall TMyService::DoSomething()
>     {
>         //...
>         this->Controller(SERVICE_CONTROL_STOP);
>         //...
>     }

As Controller is protected this will only work from within
the service class and not from other parts of the
service. However you could write a wrapper and
make it public.

Frank.
Technical Details
Message-ID: <40a88602$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40a75e29@newsgroups.borland.com> <40a7d8b1$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,c3caafa44ef41532
X-Google-Attributes: gid10cc67,public
From: "Frank Gruber" <HVFDMIPUMFPS@spammotel.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40a75e29@newsgroups.borland.com> <40a7d8b1$1@newsgroups.borland.com>
Subject: Re: Stopping a service from within itself
Date: Mon, 17 May 2004 11:29:38 +0200
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 217.225.9.132
Message-ID: <40a88602$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1084786178 217.225.9.132 (17 May 2004 02:29:38 -0700)
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail