🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #678

Re: writng Win32service in BorlandC#Builder How do I do it?

#678
From: J.A Smit
Date: Mon, 25 Oct 2004 10:50
112 lines
5010 bytes
Ok I'm a bit fearfull now that I didn't make myself any clearer with the
last mail so......

To begin with I made a typo in the last mail. The error message I get is
about "MyService" not "JurService" intially the (sub)class was called
"JurService" but I changed it to MyService in the mail to avoid confusion.
(ahhem)

I read all the documentation and in principle it's clear to me what's
involved in creating a service (the logic of it). I'm confident that I will
be able to figure it out as I go, but........
The documentation deals with SDK and MSVisual Studio C#. Their IDE has an
option for starting a "Service Application" project. That creates  the
source files and subseq. architecture for you I guess.
That's where I get stuck I need to know what sourcefiles to create and what
to put where, since Borland doesn't provide this specific apllication
template.

Well I hope that I've described my problem a lot clearer now. I still hope
the info contained in the previous mail is enlighting in some way.
regards,
J.A. Smit

"J.A Smit" <alex.zoem@wanadoo.nl> wrote in message
news:417ca911$1@newsgroups.borland.com...
> Thanks for reply,
>
> Ok to elaborate a little on where I am.
>
> I found the following example in the SDK docs witch I customised a
litttle:
> ------- Code excerpt Begin-----------
> using System;
> using System.ServiceProcess;
>
> public class MyService : System.ServiceProcess.ServiceBase
> {
> }
>
> public MyService()
> {
>  this.Servicename = "KoersTracker";
>  this.CanStop = true;
>  this.CanPauseAndContinue = true;
>  this.Autolog = true;
> }
>
> public static void Main()
> {
>  System.ServiceProcess.ServiceBase.Run(new MyService());
> }
>
> protected override void OnStart(string[] args)
> {
>  //Insert code here to define processing.
> }
> ------- Code excerpt End -----------
> When I build this get an error at "public class JurService :
> System.ServiceProcess.ServiceBase" it says  :"Expected
> class,delegate,enum,interface or struct".
> It seems like the class isn't recognised.
> Maybe important to know, I created the project as a C#  Appllication. I
> stripped everything from the main source file and inserted the code found
> above.
>
> I also found some stuff on ProcessInstaller and ServiceprocessInstaller do
I
> put it in the same sourcefile?(I think not).
>
> The main problem I have is:
> How do I build the project, file wise. As far as I can see now, you need:
> A sourcefile with the subclass of ServiceBase and a handler for the OnRun
> method.
> A sourcefile witch controls installation of the service (do I also need
the
> ServiceProcessInstaller class when I install only one service?
>
> Still unclear:
> I wanted to build(compile) the project in this state of progress just to
see
> if I got the syntax right, but the error I got leads me to assume there's
> already a syntax problem.
> I don't know what you mean by "you will need to spawn a thread........"
what
> is ment with "thread" in this context?
> What files will I eventually have (or need) in the project?
>
> Again thanks for reply, I hope this mail makes it a little more clear
where
> I'm coming from....
>
> Alex
>
> "Marc Rohloff [TeamB]" <"on request"> wrote in message
> news:hyra00h6xyiu$.dlg@marcrohloff.40tude.net...
> > On Sun, 24 Oct 2004 20:10:51 +0200, J.A Smit wrote:
> >
> > > Hi all,
> > > I'm trying to write a win service that collects some data from the www
> net
> > > and then stores this data.
> >
> > Its a bit hard to tell how far you are. Generally you start by
> > creating a subclass of the ServiceBase class and overriding the
> > methods you need. Generally you will need to spawn a thread to do the
> > work and control it from ServiceBase's methods.
> >
> > -- 
> > Marc Rohloff [TeamB]
> > marc rohloff at myrealbox dot com
>
>
Technical Details
Message-ID: <417cda99@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <417bf043$1@newsgroups.borland.com> <hyra00h6xyiu$.dlg@marcrohloff.40tude.net> <417ca911$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,a97d3f9f5adb9274
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "J.A Smit" <alex.zoem@wanadoo.nl>
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <417bf043$1@newsgroups.borland.com> <hyra00h6xyiu$.dlg@marcrohloff.40tude.net> <417ca911$1@newsgroups.borland.com>
Subject: Re: writng Win32service in BorlandC#Builder How do I do it?
Date: Mon, 25 Oct 2004 12:50:37 +0200
Lines: 114
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: 212.129.129.221
Message-ID: <417cda99@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1098701465 212.129.129.221 (25 Oct 2004 03:51:05 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail