Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-19
7
Medium Priority
?
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 10

Assisted Solution

by:ADSaunders
ADSaunders earned 375 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 375 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Assisted Solution

by:ADSaunders
ADSaunders earned 375 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

636 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