Understanding the Wizard Code
Let’s start by reviewing the code generated by the wizard. Right-click the Tutorials.vb file and select View Code. You will see the class definition along with two methods, <OnStart> and <OnStop>. They are both blank, but they are both required for your service to run properly.
The <OnStart> Method
The <OnStart> method represents the entry point into your service. This is what the underlying Service Control Manager (SCM) will call when the user clicks Start on the Control Panel Services screen. You will notice that <OnStart> has one argument. This argument contains the parameters defined in the Administrative Tools, Services, ...
Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.