Solved

VB 6: Events to start as a Service

Posted on 2002-03-22
6
147 Views
Last Modified: 2010-05-02
Greetings,

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?
0
Comment
Question by:Timelib
  • 3
  • 2
6 Comments
 
LVL 20

Accepted Solution

by:
hes earned 60 total points
Comment Utility
Look here on how to get a vb app running as a service
http://msdn.microsoft.com/library/techart/msdn_ntsrvocx.htm
More instructions and the compiled version is here

http://www.geocities.com/SiliconValley/Pines/3991/ntsvcocx.html
0
 
LVL 1

Author Comment

by:Timelib
Comment Utility
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?
0
 
LVL 20

Expert Comment

by:hes
Comment Utility
I have quite a few apps running as services using the ntsrvocx with the form set to not visable.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Expert Comment

by:anthony_glenwright
Comment Utility
You can also have a look at the NT service toolkit from desaware - www.desaware.com
0
 
LVL 1

Author Comment

by:Timelib
Comment Utility
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?
0
 
LVL 1

Author Comment

by:Timelib
Comment Utility
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.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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 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…

771 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

11 Experts available now in Live!

Get 1:1 Help Now