Run a Visual Basic Application as a Windows Service
I remember a long time ago that I looked in to how one would make a Visual Basic application run as a Windows service. I didn't actually need to do it at the time, but I was curious. Well, today, I needed to do it. Apparently it's a bit of a big deal because of the threading model used by Visual Basic.
Microsoft has released a handy OCX for just this purpose. They also provide dire warnings and caveats but we all know that's just to cover their you know what. I've found that these unsupported tools from Microsoft are a little rough around the edges, but they run without problems. Anyway, the OCX is called NTSVC.ocx. If interested, take a look at some sample code and then download the OCX itself.
I've tested the OCX under Windows 2000. So far so good. Next up is Windows XP. Fortunately, my needs don't go beyond these two operating systems.

Matt,
Feel free to write a tutorial. I'd certainly appreciate a link or a mention.
Thanks for this great article. I do a lot of development in Visual Basic 6 and running a app as a Windows Service is a hot topic. Do you mind if I maybe write a tutorial around this to add to my Visual Basic Tutorials site?
I have run into issues using the OCX due to timeouts when the service starts. Everything worked fine until we reinstalled the service. It seems that something in the OS has changed in the last 12 months and now there are issues. The server has all of MS's patches applied.