Export (0) Print
Expand All

SWbemObject.SpawnDerivedClass_ method

Use the SpawnDerivedClass_ method of the SWbemObject object to create a derived class object from the current object. The object must be a class definition that becomes the parent class of the spawned object.

For an explanation of this syntax, see Document Conventions for the Scripting API.


objNewClass = .SpawnDerivedClass_( _
  [ ByVal iFlags ] _


iFlags [optional]

Reserved and must be 0 (zero) if specified.

Return value

If the call is successful, the SWbemObject object contains the new class definition object. No object returns when there is an error.

Error codes

After the completion of the SpawnDerivedClass_ method, the Err object may contain one of the error codes in the following table.

Error (Name/Dec/Hex)Meaning
2147749889 (0x80041001)

Unspecified error.

2147749918 (0x8004101E)

User requested an illegal operation, such as spawning a class from an instance.

2147749920 (0x80041020)

Source class was not completely defined or registered with WMI, so a new derived class is not permitted.

2147749894 (0x80041006)

Not enough memory to complete the operation.


The object that is returned automatically becomes a subclass of the current object. This behavior cannot be overridden. There is no other method by which you can create derived classes.

You cannot create a derived class from a class that is local to your own client process. Before use this method to create a derived class, you must create the base class. To create the base class, call SWbemObject.Put_, and retrieve the base class using SWbemServices.Get.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Type library






© 2015 Microsoft