Updating the Service Events
We want to use the new service events properly by modifying the current events. This will allow us to reuse these structured literals quickly.
Modifying Our <OnStart>
We will be modifying our current tutorials.vb thread function code to reflect both the changes in using our resource file and to use our new InstanceId constants.
Example 4-4. Modifications to <OnStart> to support the new resource file.
Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. Try m_WorkerThread = New Thread(AddressOf ThreadFunc) m_WorkerThread.Name = My.Resources.ThreadName m_WorkerThread.Priority = ThreadPriority.Normal m_WorkerThread.Start() ...
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.