Export (0) Print
Expand All

#include

The #include preprocessor command includes the contents of one MOF file into another MOF file. The following code example describes the syntax for the #include command.

#include ("Moffile.mof")

In the previous example, Moffile.mof is the name of the MOF file to include.

The following example shows two MOF files. When you compile the first MOF file, the compiler automatically compiles the second MOF file (Mymof2.mof) in the location you place the #include statement.

/*   Title: MyMof.Mof                           */
/*                                              */ 
/*   This MOF file shows how to include  */
/*   an MOF file in another MOF file             */

#pragma namespace("\\\\.\\root")            

#include ("mymof2.mof")

class myclass1 
{
    [key] string Description;
};


instance of myclass1
{
    Description = "Description of myclass1";
};
/*   End of MyMof.Mof                           */

The following MOF file is included in the previous example:

/*   Title: MyMof2.Mof                               */
/*                                                   */
/*   This MOF is included when MyMof.MOF is compiled */

class myclass2 
{
    [key] string Description;
};


instance of myclass2
{
    Description = "Description of myclass2";
    
};

Related topics

Preprocessor Commands

 

 

Show:
© 2015 Microsoft