Solved

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

Posted on 2004-08-19
7
271 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Passing a Text Box name to a Sub 6 99
Problem to With line 4 63
IF ELSE Statement in Excel Macro VBA 16 75
transition to visual .net from vb6 5 37
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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