Windows Dev Center

CInstance class

[The CInstance class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The CInstance class is used to retrieve and update the values of properties defined for the instances supported by the WMI Provider Framework. The CInstance class also provides access to the provider framework's implementation of the CInstance interface.

It is not expected that provider writers will need to derive from this class. Use Provider::CreateNewInstance to create an instance of this class.

CInstance has these types of members:

Methods

The CInstance class has these methods.

MethodDescription
Commit

Returns the current instance to WMI.

Getbool

Retrieves a Boolean property.

GetByte

Retrieves a BYTE-compatible property.

GetCHString

Retrieves a string property.

GetClassObjectInterface

Returns an IWbemClassObject interface pointer.

GetDateTime

Returns a datetime property.

GetDOUBLE

Retrieves a DOUBLE property.

GetDWORD

Retrieves a DWORD property.

GetEmbeddedObject

Retrieves an embedded CInstance property.

GetMethodContext

Returns a pointer to a MethodContext object.

GetStatus

Determines whether a property exists and, if so, determines its type.

GetStringArray

Retrieves a property that represents an array of strings.

GetTimeSpan

Retrieves a property that represents a WMI time span.

GetVariant

Retrieves a VARIANT property.

GetWBEMINT16

Retrieves a 16-bit integer property.

GetWBEMINT64 Overloaded.

Retrieves a 64-bit integer property.

GetWCHAR

Retrieves a WCHAR property.

GetWORD

Retrieves a WORD property.

IsNull

Determines if the value of a particular property is NULL.

Setbool

Sets a Boolean property.

SetByte

Sets a BYTE property.

SetCharSplat Overloaded.

Sets a string property.

SetCHString Overloaded.

Sets a string property.

SetDateTime

Sets a datetime property.

SetDOUBLE

Sets a DOUBLE property.

SetDWORD

Sets a DWORD property.

SetEmbeddedObject

Sets an embedded CInstance property.

SetNull

Sets a property to NULL.

SetStringArray

Sets a property that represents an array of strings.

SetTimeSpan

Sets a property that represents a time span.

SetVariant

Sets a VARIANT property.

SetWBEMINT16

Sets a 16-bit integer property.

SetWBEMINT64 Overloaded.

Sets a 64-bit integer property.

SetWCHARSplat

Sets a WCHAR string property.

SetWORD

Sets a WORD property.

 

Remarks

The destructor for this class is CInstance::~CInstance.

Methods of the CInstance class are used to retrieve and set property values. Property data types are defined using CIM data types which can be seen in a .mof file. When querying or setting a property value using CInstance methods, it is necessary to use a method that is compatible with the property's CIM data type. The following table lists CIM data types and the permissible CInstance get or set methods for accessing a property of that data type.

CIM data typeCInstance Get/Set method types
string

CHString

VARIANT

WCHAR

CharSplat

sint8

VARIANT

uint8

BYTE

sint16

WBEMINT16

VARIANT

uint16

WORD

DWORD

VARIANT

sint32

WORD

DWORD

VARIANT

uint32

WORD

DWORD

VARIANT

sint64

CHString

VARIANT

WBEMINT64

WCHAR

uint64

CHString

VARIANT

WBEMINT64

WCHAR

real32

VARIANT

real64

CHString

DOUBLE

VARIANT

char16VARIANT
DateTime

CHString

DateTime

VARIANT

WCHAR

 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Instance.h (include FwCommon.h)

Library

Framedyn.lib

DLL

Framedyn.dll

 

 

Show:
© 2015 Microsoft