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. ...

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.