description | ms.assetid | ms.tgt_platform | title | ms.topic | ms.date | topic_type | api_name | api_type | api_location | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Clone\_ method of the SWbemObject object returns a new object that is a clone of the current object. |
d0773c94-30b5-4217-8a9a-0bceb9e75f02 |
multiple |
SWbemObject.Clone_ method (Wbemdisp.h) |
reference |
05/31/2018 |
|
|
|
|
The Clone_ method of the SWbemObject object returns a new object that is a clone of the current object.
For an explanation of this syntax, see Document Conventions for the Scripting API.
objWbemObject = .Clone_( _
)
This method has no parameters.
If successful, this method returns a new SWbemObject object.
After completion of the Clone_ method, the Err object may contain one of the error codes below.
-
wbemErrFailed - 2147749889 (0x80041001)
-
Unspecified error.
-
wbemErrInvalidParameter - 2147749896 (0x80041008)
-
Nothing was specified as a parameter, and it is not acceptable in this usage.
-
wbemErrOutOfMemory - 2147749894 (0x80041006)
-
Not enough memory to clone the object.
Use the Clone_ method to duplicate a class definition or an instance. This is useful when you need the original copy of the object for backup purposes while you are modifying a new copy. Likewise, use this method to create many new instances from a single source instance. For example, use SWbemObject.SpawnInstance_ to create a single starting instance, and use SWbemObject.Clone_ to produce 100 copies of the instance quickly. Subsequently, you can modify the objects, giving each one specific values.
It is not possible to use this method to convert a class definition to an instance, or to convert an instance to a class definition.
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 |
Header |
|
Type library |
|
DLL |
|
CLSID |
CLSID_SWbemObject |
IID |
IID_ISWbemObject |