Solved

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

Posted on 2004-08-19
7
260 Views
Last Modified: 2010-05-02
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
Comment
Question by:debjitk
  • 3
  • 3
7 Comments
 
LVL 10

Assisted Solution

by:ADSaunders
ADSaunders earned 125 total points
ID: 11850299
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
 

Author Comment

by:debjitk
ID: 11850662
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
 
LVL 10

Accepted Solution

by:
ADSaunders earned 125 total points
ID: 11850708
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 10

Assisted Solution

by:ADSaunders
ADSaunders earned 125 total points
ID: 11850735
.. 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
 

Author Comment

by:debjitk
ID: 11855470
Hi i checked the code at: http://www.freevbcode.com/ShowCode.Asp?ID=4317 but quite confused.
0
 

Expert Comment

by:Mandtis
ID: 11857205
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
 

Author Comment

by:debjitk
ID: 11860771
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now