SWbemLastError.Clone_ method

The Clone_ method of the SWbemLastError object returns a new object that is a clone of the current SWbemLastError object.

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

Syntax

objWbemObject = .Clone_( _
)

Parameters

This method has no parameters.

Return value

If the Clone_ method is successful, it returns a new SWbemLastError object.

Error codes

Upon the completion of the Clone_ method, the Err object may contain one of the error codes below.

wbemErrFailed - 2147749889 (0x80041001)

Unspecified error.

wbemErrInvalidParameter - 2147749896 (0x80041008)

A specified parameter is not valid.

wbemErrOutOfMemory - 2147749894 (0x80041006)

Not enough memory to complete the operation.

Remarks

Use the Clone_ method to duplicate a class definition or instance. This method is useful when you need to back up the original copy of the object while you modify a new copy. Also, 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 SWbemLastError.Clone_ to produce 100 copies of the instance quickly. Subsequently, you can modify the objects, giving specific values to each object.

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.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Wbemdisp.h
Type library
Wbemdisp.tlb
DLL
Wbemdisp.dll
CLSID
CLSID_SWbemLastError
IID
IID_ISWbemLastError