Article View: borland.public.cppbuilder.nativeapi
Article #1734TService Compile Error
From: Jeff
Date: Mon, 25 Jun 2007 20:49
Date: Mon, 25 Jun 2007 20:49
48 lines
2520 bytes
2520 bytes
I've got a service application that doesn't seem to compile anymore (code
below). I'm not sure what's going on but it appears that my class
declaration doesn't work. I'm using BDS 2006.
UnitService.cpp:
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TsrvMain *srvMain;
I get three errors on the pointer declaration (TsrvMain *srvMain):
[C++ Error] UnitService.cpp(8): E2141 Declaration syntax error
[C++ Error] UnitService.cpp(15): E2090 Qualifier 'TsrvMain' is not a
class or namespace name
[C++ Error] UnitService.cpp(15): E2040 Declaration terminated
incorrectly
Here's part of UnitService.h:
class TsrvMain : public TService
{
__published: // IDE-managed Components
void __fastcall ServiceExecute(TService *Sender);
void __fastcall ServiceStart(TService *Sender, bool &Started);
void __fastcall ServiceAfterInstall(TService *Sender);
void __fastcall ServiceBeforeUninstall(TService *Sender);
private: // User declarations
bool __fastcall IsTime();
public: // User declarations
WORD wHour;
WORD wMin;
bool boolLogUsers;
__fastcall TsrvMain(TComponent* Owner);
TServiceController __fastcall GetServiceController(void);
friend void __stdcall ServiceController(unsigned CtrlCode);
};
//---------------------------------------------------------------------------
extern PACKAGE TsrvMain *srvMain;
//---------------------------------------------------------------------------
I don't understand why it thinks my class is not declared?
Thanks,
Jeff
Technical Details
Message-ID:
<46802aa8$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-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e4ab627349eb1efd,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Jeff" <Jeff@nospam.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: TService Compile Error Date: Mon, 25 Jun 2007 14:49:42 -0600 Lines: 50 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 NNTP-Posting-Host: 206.104.31.90 Message-ID: <46802aa8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1182804648 206.104.31.90 (25 Jun 2007 13:50:48 -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