Adding a Module File

We will continue this chapter by extending the already-existent code from Chapter 2. We will modify the existing code to help us resolve the addition of the new module.

The service is going to continue to grow, so to help to keep things cleaner and more readable, let’s add a module file to the project. In the Solution Explorer, click the Tutorials project icon and select Add Module. Name the file modService.vb and click Add.

As shown in Example 4-1, cut and paste the THREAD_WAIT definition from the Tutorials.vb file into the modService.vb and change the definition from Private to Public.

Example 4-1. Move the THREAD_WAIT definition to the modService file.

Module modService
  Public Const THREAD_WAIT As Integer = 5000

Adding Event ...

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.