Muokkaa

Jaa


SWbemPropertySet.Remove method

The Remove method of the SWbemPropertySet object deletes a property from the SWbemPropertySet collection.

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

Syntax

SWbemPropertySet.Remove( _
  ByVal strName, _
  [ ByVal iFlags ] _
)

Parameters

strName [in]

Required. Name of the item to remove.

iFlags [in, optional]

Reserved. This value must be 0 (zero) if specified.

Return value

This method does not return a value.

Error codes

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

wbemErrFailed - 2147749889 (0x80041001)

Unspecified failure.

wbemErrInvalidOperation - 2147749910 (0x80041016)

User attempted to delete a property that cannot be deleted.

wbemErrInvalidParameter - 2147749896 (0x80041008)

Invalid parameter was specified.

wbemErrNotFound - 2147749890 (0x80041002)

Specified property does not exist.

wbemErrOutOfMemory - 2147749894 (0x80041006)

Not enough memory for this method to execute.

wbemErrPropagatedProperty - 142927303552 (0x2147219380)

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

wbemErrResetToDefault - 2147758082 (0x80043002)

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

Remarks

Properties cannot be removed from class instances or derived classes with inherited properties. Such deletion attempts raise an error and the property is not removed; the property is reset to its default value.

You cannot iterate a collection while removing items because when you remove an element from a collection, the collection pointer is moved to the next element. For more information, see Accessing a Collection.

Examples

For a code example that uses this method, see the SWbemPropertySet topic.

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_SWbemPropertySet
IID
IID_ISWbemPropertySet

See also

SWbemPropertySet

SWbemPropertySet.Add