TD Application running as NT Service.

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

TD Application running as NT Service.

Post by ivano_osti » 13 Aug 2007, 17:33

 Posted by:  Ivano Edilberth Osti 

Hi. Excuse-me if I'm double writting this. I'm writting again because I
wrote to forum.td.development and I could not see my subject there.

I know that I can put my application to run as "Service" using XYNTService
or SrvAny.

I downloaded a pretty good sample from "forum.sourcecode" time ago and it
works fine but the problem is that the service runs only for 5 minutes and
then it stops.

Do you have a tip on how to put the service to run full time?

Taking a look at the code that builds the function, I see this:
///////////////////////////////////////////////////////////////////////////////////////////////
// main function to do the real work of the service

// This function performs the main work of the service.
// When this function returns the service has stopped.
void VTBRun()
{

while (m_bIsRunning) {
m_bIsRunning = FALSE;
// must be reset to TRUE by using Function VTBMarkRunning
VTBSendMsg(VTBService_GoLoop);
Sleep(5000);
}

// nothing more to do
}

BOOL VTBMarkRunning()
{
m_bIsRunning = TRUE;
return TRUE;
}

The problem is that there is not a function called "VTBMarkRunning" inside
VTBService.dll

If you have a newer version of VTBService.dll or other sample on how to put
a TD application running as service, please tell me.

Thanks in advance.

PS: Attached the sample that I downloaded


You do not have the required permissions to view the files attached to this post.

RainerE
Germany
Posts: 2166
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: TD Application running as NT Service.

Post by RainerE » 14 Aug 2007, 11:26

 Posted by:  Rainer Ebert 

I can't help you directly, but an additional information: We use ntsvc.ocx
to implement a service. This works pretty fine. There's an example in the
old newsgroups. Search for "App running as service" in the new newsgroups or
for "ctd application as service" in the old newsgroups.

Rainer

ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Re: TD Application running as NT Service.

Post by ivano_osti » 14 Aug 2007, 14:59

 Posted by:  Ivano Edilberth Osti 

Hi Rainer.

I've followed your tip and I found a thread "ntService 3.1" with
NTService_31.zip.

The problem is that I'm just having success to extract the .APL file. My
extraction fails for the others. I don't know what is happening...

The file is attached. Could you or other friends try to extract them to me
(or maybe other .zip)?

Thank you a lot for your help

Warmest regards.

You do not have the required permissions to view the files attached to this post.

RainerE
Germany
Posts: 2166
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: TD Application running as NT Service.

Post by RainerE » 14 Aug 2007, 16:40

 Posted by:  Rainer Ebert 

The problem are the links included. WinZip cannot handle them. The built in
zip functionality of WindowsXP can. I've removed them - see attachement. But
note: IIRC, there is a better example.

Regards Rainer

You do not have the required permissions to view the files attached to this post.

ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Re: TD Application running as NT Service.

Post by ivano_osti » 14 Aug 2007, 20:09

 Posted by:  Ivano Edilberth Osti 

Hi Rainer.

I have the files now.

>
I could not understand. Excuse-me.

Thanks once more..

PS: If someone has a newer version of "VTBService.dll" or knows how to put
this DLL to work more than 5 minutes, please tell me.

RainerE
Germany
Posts: 2166
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: TD Application running as NT Service.

Post by RainerE » 15 Aug 2007, 11:09

 Posted by:  Rainer Ebert 


If I remember correctly, there is a better example (in the old newsgroups).

Rainer

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests