O'Reilly logo

Programming Windows® Services with Microsoft® Visual Basic® 2008 by Michael Gernaey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the WMI Class

In this chapter we will use our WMI class to extend the code in Chapter 3. We will use the code to collect information about the local system and log an event.

Adding New EventLog Constants

We will add the constants shown in Example 8-3 to the top of the modService.vb file so that we can write the correct EventID to the Application log.

Example 8-3. Application log EventID constants.

Public Const WMI_ERROR As Integer = 1010
Public Const WMI_INFO As Integer = 2007
Public Const CONFIG_READ_ERROR As Integer = 4000

Updating <Tutorials.ThreadFunc>

In this section we will add the WMI class to the Chapter 4 code and then write the code to use this class. Because we will build onto existing code, we do not need to create a new project. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required