Solved

VB 6: Events to start as a Service

Posted on 2002-03-22
6
148 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
ID: 6889750
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
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?
0
 
LVL 20

Expert Comment

by:hes
ID: 6890226
I have quite a few apps running as services using the ntsrvocx with the form set to not visable.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

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

Author Comment

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

Author Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
add text to end of existing text in file 16 69
VBA error replacing data 6 37
How to compare ms sql hashbytes results within vb6 5 55
Protecting vb6 & .Net code Obfuscation 18 96
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now