How to debug a service in VB6

I have a problem in a Windows Service I created: when I call the StartService API function, it appears the typical Windows message saying the application crashed.

So I imagine I have a problem in the code that implements the service, but I don't know how can I debug. I created a log system (writing to a file) but the code inside the service doesn't write anything inside.

Could you show me any ideas to know how to debug this part of code ?

Many thanks.
LVL 15
gplanaAsked:
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.

dlmichenerCommented:
In VB6 under the Project Properties, Debug tab you can say "Wait for ..."
I would try to Run > "Start with Full Compile" putting a break point in the StartService code and then start your service.  Hopefully, VB6 will intercept the request from service manager.
0

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
gplanaAuthor Commented:

Sorry, but all controls under the debug tab appears disabled. The first option "Wait component creation" is checked (but disabled also).

I tried to put the breakpoint on the start service code, but it doesn't stops, because he calls another process (well, the same .exe program but with other parameters).
0
Deepu SreedharBI Software EngineerCommented:
What I am doing for debugging the service is, Copy the source code into a GUI application and Start Service Code will be changed to a button click event. I hope you got what I mean.
0
gplanaAuthor Commented:
Ok, the problem was I have more than one process and I were debugging the other one.

Thank you for your support.
0
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
Software

From novice to tech pro — start learning today.