?
Solved

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

Posted on 2004-08-19
7
Medium Priority
?
282 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 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