🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TServiceApplication and Windows 2003

#1019
From: Andrew Fedoseev
Date: Sun, 04 Nov 2007 15:19
45 lines
2503 bytes
solved
"Andrew Fedoseev" <andrewxf@gmail.com> �������/�������� � �������� 
���������: news:472da042$1@newsgroups.borland.com...
> Hi there!
>
> Here's the excerpt of what you get when you start to write such an 
> aplication:
>
> // Windows 2003 Server requires StartServiceCtrlDispatcher to be
>  // called before CoRegisterClassObject, which can be called indirectly
>  // by Application.Initialize. TServiceApplication->DelayInitialize allows
>  // Application->Initialize to be called from TService->Main (after
>  // StartServiceCtrlDispatcher has been called).
>  //
>  // Delayed initialization of the Application object may affect
>  // events which then occur prior to initialization, such as
>  // TService->OnCreate. It is only recommended if the ServiceApplication
>  // registers a class object with OLE and is intended for use with
>  // Windows 2003 Server.
>  //
>  // Application->DelayInitialize = true;
>  //
>
> Unfortunately, my service aplication is designated to work under Windows 
> 2003 OS. So, if a inderstood right i should
> put this code below into TService OnCreate method:
> ......
>  SERVICE_TABLE_ENTRY   DispatchTable[1];
>  DispatchTable[0].lpServiceName = this->DisplayName.c_str();
>  DispatchTable[0].lpServiceProc = this->Main; //<-and surely, i get an 
> compiler error messagehere
>
> StartServiceCtrlDispatcher(DispatchTable);
> ......
>
>
> How do i get this working? How do i connect DispatchTable[0].lpServiceProc 
> to whatever TService class has?
>
> Thanks in advance,
> Andrew.
>
>
>
> 
Technical Details
Message-ID: <472de38e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <472da042$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2ed8580c37084c9b
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII
From: "Andrew Fedoseev" <andrewxf@gmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <472da042$1@newsgroups.borland.com>
Subject: Re: TServiceApplication and Windows 2003
Date: Sun, 4 Nov 2007 18:19:28 +0300
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 85.30.225.113
Message-ID: <472de38e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1194189710 85.30.225.113 (4 Nov 2007 07:21:50 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail