Custom NT Service not starting correctly

I have written a .exe program to run as a service.
For some reason, it will not start correctly.  I have installed the Microsoft NT Service Control and I call it and it says that it installed correctly according to a log I am writing to but then I get a message from the Services window (where I am trying to start from) that says,

"Could not start the CustomService service on Local Computer.  The service did not return an error.  This could be an internal Windows error or an internal service error.  If the problem persists, contact your system administrator."

The process in the program is:
Check command line arguments.
Attempt to start the service.
If successful, interval and enable a timer to perform tasks.

BAM!  It stops.  It never gets to do anything else.  What I need is to figure out what the problem is but I don't get feedback and I am not trapping any errors.

Any ideas on how to go about solving this?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Place msgbox's all over your service code to see where it broke.  The equivalent of "here 1", "here 2" maybe with some varible info etc. Or, do the same thing but write output to a file as you're going.  You're down to the manual way it sounds like.

Or you could paste your code up here if you want someone else to look at it.

Well can you paste the code that sets the timer off here? The whole subroutine.

Also are you relying on any other services to start up before your service starts?

Also what type of service have you installed it as? e.g. Local System Account (Interactive enabled/disabled) or is it under Domain Account?
BobsExExAuthor Commented:

Well I have found what it takes to get this thing to start.  I found it by disassembling a program that DOES start as a service, piece by piece, running it after each change...

Anyway, the NT Service Control has a related "Start" subroutine.  When this event is omitted OR the "Success= True" statement is not within the subroutine, the service won't start successfully.  I am sure that anyone would want to put more checking inside this event but right here is the make or break code to getting my service running.  As Follows:
Private Sub ctlService_Start(Success As Boolean)
    Success = True
End Sub

Dear expert(s),

A request has been made to close this Q in CS:

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.


Community Support Moderator
Experts Exchange
Saving this Q as a PAQ and refunding the points to the questionner


Community Support Moderator
Experts Exchange

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.