• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

VB 6.0 application as NT/2000 Service (without forms or OCX)

I am using the component SVCIT from ServiceMill for creating VB 6.0 Application to run as NT/2000 service. Now there are two things i need to know, is SVCIT better than NTSVC.OCX. Which one of them is more reliable since i am developing an application for a 24/7 environment and thus my app has to be very stable and reliable.

Now the second issue is my app reads all parameters from the windows registry whenever the service starts/restarts thus i do not need a form for the service application.

So can anyone help me regarding how to create a stable VB 6.0 application that would run as a service and does not need a form or any OCX control.

I small question along with that. When the Stop/Pause event fires in SVCIT or in NTSVC.OCX does the app stops automatically or i can wait for the current job to complete then stop/pause the app?

Regards,

Debjit Kar
0
debjitk
Asked:
debjitk
  • 3
  • 3
3 Solutions
 
ADSaundersCommented:
Hi debjitk,
I haven't used SVCIT, but have created several very stable NT services using the NTSVC ocx. SImilarly my services read (and write) control information to/from the registry. You do need a form, on which to 'plant' the OCX. I just set it's visible property to 'false'. Well Actually, I make the form visible or not depending on whether I'm in Debug mode.

The stop/pause event does not actually stop the service, it's up to your code to respond to it appropriately, and return a success code. One service I am running is a shop floor data collection service, reading data from a series of Programmable logic controllers, and writing it via ODBC (ADO) to a Progress (tm) database. This of course needs to close all connections, and close the ODBC connection before it shuts down. It's been running 24/7 now for several months, and I have not yet had a comms lockup, or a database corruption.

Regards .. Alan
0
 
debjitkAuthor Commented:
So i can rely on NTSVC ocx? And there no prob in developing service app in VB 6.0 like this? So you ae assuring that crreating app like this ca be very stable.

I liked your suggestion....
but not closing the question here since i also wanted to know how to create VB 6.0 app to run as service without using Forms or any OCX controls.
 
0
 
ADSaundersCommented:
So far, I have written services with VB6 + NTSVC.ocx to do the following:
Watch an exchange mailbox, and process incoming mail
Shop floor data collection (as mentioned above)
Intranet document publishing service
Intranet document validation and management service
 - This is not all, just the more recent ones. I am categorically NOT stating that YOU can rely on VB6 + NTSVC.ocx (I don't know your programming skills :-) .)  -- But I do.

Regards .. Alan
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ADSaundersCommented:
.. As to creating without NTSVC.ocx, you could have a look at these links:
http://www.freevbcode.com/ShowCode.Asp?ID=4317
http://www.smsoft.ru/en/ntservice.htm

.. Alan
0
 
debjitkAuthor Commented:
Hi i checked the code at: http://www.freevbcode.com/ShowCode.Asp?ID=4317 but quite confused.
0
 
MandtisCommented:
You could also make your program as normal, and use the following freeware program to get it to run as a service:
http://www.judoscript.com/goodies/RunExeSvc/index.html
Greets!
0
 
debjitkAuthor Commented:
Hello,

I am closing this question with thanks to ADSaunders.

Indeed if you want to create a windows service in VB 6.0 then the best options are to use NTSVC.OCX or ServiceMill Control.

Very recetly after i posted this question i tried my hands on VB.net Windows Services. They rock man! Anyone trying to create a windows service i would suggest VB.net instead of VB 6.0.

Generally it is not recommended to use VB 6.0 to create windows service.

Honestly, in VB.net creating a windows service is quite a wonderfull experience.

But if you still want to create your windows service in VB 6.0 then use NTSVC.OCX or ServiceMill Control.

Thx again to ADSaunders.

Regards,

Debjit Kar
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now