This section describes the dmitest code sample (DMITEST.EXE), a Win32 console application that uses the WBEM API to access and manipulate a DMI 2.0 enabled Win32 platform. The sample includes examples of DMI 2.0 MIF files that will be used to install components in the DMI database.
The same code reads input data from a script file, DMITEST.SCR, processes the command script, and makes appropriate WBEM API calls to access the DMI database. The application then will store the output data into a file called DMITEST.OUT.
The DMITEST application relies on the user to ensure that the DMI 2.0 Service Provider is already running on the system and that the WBEMDMIP.MOF file has already been compiled and installed into the CIMOM's repository to enable DMI operations.
The DMITEST code sample was developed using Microsoft Visual C++ version 5.0, and is in the \WBEM\SDK\COM\DMITEST directory.
The DMITEST' s MIF data
The application uses the MIF files DBTYPES1.MIF and TEMPCOM1.MIF to install three components in the DMI database and access them through the DMI provider. The DBTYPES1.MIF is installed twice.
The DMITEST.SCR script uses hard-coded path of C:\TESTMIFS for the location of the above two MIF files. To access the MIF files from a different directory, change the DMITEST.SCR file to look for the correct path.
The files included in this sample
Sample File | Description |
---|---|
DMITEST.CPP | Main source file for the DMITEST application responsible for reading and processing command scripts from the DMITEST.SCR input file and submitting DMI requests to WBEM. |
DMITEST.H | Header file for DMITEST.CPP module. |
DMITEST.SCR | Containing the DMI command scripts processed by the DMITEST application. |
DMITEST.OUT | DMITEST application generated output file containing the results from executing the DMI service requests. |
DATATYPES.CPP | Code for manipulating the OLE data types used by DMITEST.CPP. |
DATATYPES.H | Header file for DATATYPES.CPP. |
DEFINES.H | Header file of definitions used to turn off some sections of the WINDOWS.H header file not used by the application. |
WBEMSVC.H | Header file containing the CIMOM interface definitions. |
DBTYPES1.MIF | MIF file used to install a DMI component called "First Database Types MIF." |
TEMPCOM1.MIF | MIF file used to install a DMI component called "Test System Temporary Component." |
DMITEST.DSP, DMITEST.DSW | Visual C++ 5.0 project file used to build the DMITEST.EXE executable. |