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


VB 6: Events to start as a Service

Posted on 2002-03-22
Medium Priority
Last Modified: 2010-05-02

I've been spending the last few days trying to write a VB 6 exe so it will work as a service.

I've gotten it installed and setup up as a service, but when the service is started, the exe doesn't start like it would if you double clicked on the exe.

Is there a event that triggers when you run start it as a service?
Question by:Timelib
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
  • 2
LVL 20

Accepted Solution

hes earned 240 total points
ID: 6889750
Look here on how to get a vb app running as a service
More instructions and the compiled version is here


Author Comment

ID: 6890219
Ok, that is a nice way to work out the NT Service coding. It would be what I want, but I don't want to use a form.

I've tried to reference it, but it fails to start the service.

Any ideas on a known form needed way?
LVL 20

Expert Comment

ID: 6890226
I have quite a few apps running as services using the ntsrvocx with the form set to not visable.
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.


Expert Comment

ID: 6890242
You can also have a look at the NT service toolkit from desaware - www.desaware.com

Author Comment

ID: 6890247
Ah, ok I guess making the only form invisiable is exceptable.

However, once I have it installed as a service. How do I get it to start running my program?

The NTSVC.oxc is a create help in setting up the Service interface, but what do I use to have the program run without having to start it at NTService.ServiceStart?

Author Comment

ID: 6890273
Ah found out how, made a timer on the form run my program after it started.

The NTSVC.ocx is create, easy. And making the form invisable allows the service to run nicely. Thanks.

Featured Post

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!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
Suggested Courses

604 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