pragma classflags

The pragma classflags preprocessor command controls the way WMI creates or updates classes depending on the flags specified.

The following describes the syntax for this command:

#pragma classflags ("[flag1], [flag2]")

[Flag] must be one or more of the following arguments. You can combine any flags that do not contradict each other.

createonlyInstructs the compiler not make any changes to existing classes and terminates a compilation if a class specified in the MOF file already exists in WMI.
forceupdateForces updates of classes when conflicting child classes exist. For example, if you define a class qualifier in a child class and the base class attempts to add the same qualifier, using this flag causes the compiler to resolve this conflict by deleting the conflicting qualifier in the child class. If the child class has instances, the update fails.
safeupdateAllows the compiler to update classes even if child classes exist, if the change does not cause conflicts with child classes. For example, this flag allows you to add a new property to a base class without also having to add the property to any pre-existing child class. If the child classes have instances, the update fails.
updateonlyInstructs the compiler to not create any new classes and causes the compiler to terminate the compilation if a class specified in the MOF file does not exist.



The following example shows how to use this command with the updateonly and forceupdate flags.

#pragma classflags ("updateonly", "forceupdate")


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

See also

Preprocessor Commands