Export (0) Print
Expand All

IWbemClassObject::Delete method

The IWbemClassObject::Delete method deletes the specified property from a CIM class definition and all of its qualifiers. Because instances cannot have contents that are different from the owning class, delete operations for properties are only possible on class definitions. If you invoke Delete on a property in an instance, the operation succeeds; however, rather than removing the value, it is simply reset to the default value for the class.

It is not possible to delete a property inherited from a parent class. However, if an override default value for a property inherited from a parent class was specified, it is possible to revert to the parent's default value by invoking this method. In this case, WBEM_S_RESET_TO_DEFAULT is returned.

System properties cannot be deleted.

Syntax


HRESULT Delete(
  [in]  LPCWSTR wszName
);

Parameters

wszName [in]

Property name to delete. This must point to a valid LPCWSTR. It is treated as read-only.

Return value

This method returns an HRESULT indicating the status of the method call. The following table lists the value contained within an HRESULT. For general HRESULT values, see System Error Codes.

Return codeDescription
WBEM_E_FAILED

There has been a general failure.

WBEM_E_INVALID_OPERATION

The user attempted to delete a property which cannot be deleted.

WBEM_E_INVALID_PARAMETER

An invalid wszName value was specified.

WBEM_E_NOT_FOUND

The specified property does not exist.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the operation.

WBEM_E_PROPAGATED_PROPERTY

The user attempted to delete a property that was not owned. The property was inherited from a parent class.

WBEM_E_SYSTEM_PROPERTY

The user attempted to delete a system property.

WBEM_S_NO_ERROR

The call succeeded.

WBEM_S_RESET_TO_DEFAULT

The caller deleted an override default value for the current class. The default value for this property in the parent class has been reactivated.

 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wbemcli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

CIMWin32.dll;
Esscli.dll;
Evntrprv.dll;
Fastprox.dll;
Framedyn.dll;
Krnlprov.dll;
Ncprov.dll;
Wbemcore.dll;
Wbemess.dll;
Wmipiprt.dll

See also

IWbemClassObject
WMI System Properties

 

 

Show:
© 2014 Microsoft