🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

TServiceApplication and Windows 2003

#1017
From: Andrew Fedoseev
Date: Sun, 04 Nov 2007 10:32
38 lines
2309 bytes
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: <472da042$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2ed8580c37084c9b,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andrew Fedoseev" <andrewxf@gmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: TServiceApplication and Windows 2003
Date: Sun, 4 Nov 2007 13:32:20 +0300
Lines: 42
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; Original
NNTP-Posting-Host: 85.30.225.113
Message-ID: <472da042$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1194172482 85.30.225.113 (4 Nov 2007 02:34:42 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail