'#include'
/* Titel: MyMof.Mof / / Titel: MyMof2.Mof */
De opdracht #include preprocessor bevat de inhoud van een MOF-bestand in een ander MOF-bestand. In het volgende codevoorbeeld wordt de syntaxis voor de opdracht #include beschreven.
#include ("Moffile.mof")
In het vorige voorbeeld is Moffile.mof de naam van het MOF-bestand dat moet worden opgenomen.
In het volgende voorbeeld ziet u twee MOF-bestanden. Wanneer u het eerste MOF-bestand compileert, compileert de compiler automatisch het tweede MOF-bestand (Mymof2.mof) op de locatie waar u de #include-instructie plaatst.
/* 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 */
Het volgende MOF-bestand is opgenomen in het vorige voorbeeld:
/* Title: MyMof2.Mof */
/* */
/* This MOF is included when MyMof.MOF is compiled */
class myclass2
{
[key] string Description;
};
instance of myclass2
{
Description = "Description of myclass2";
};
Verwante onderwerpen