Export (0) Print
Expand All

IWbemClassObject::GetObjectText method

The IWbemClassObject::GetObjectText method returns a textual rendering of the object in the MOF syntax. Notice that the MOF text returned does not contain all the information about the object, but only enough information for the MOF compiler to be able to re-create the original object. For instance, no propagated qualifiers or parent class properties are displayed.

Syntax


HRESULT GetObjectText(
  [in]   LONG lFlags,
  [out]  BSTR *pstrObjectText
);

Parameters

lFlags [in]

Normally 0. If WBEM_FLAG_NO_FLAVORS is specified, qualifiers will be presented without propagation or flavor information. If WBEM_FLAG_NO_SEPARATOR is specified, the trailing semicolon after a class or instance declaration will be omitted from the MOF text. These flags may be combined.

pstrObjectText [out]

This must point to NULL on entry. This parameter receives from Windows Management a newly allocated BSTR that was initialized with SysAllocString. You must call SysFreeString on the pointer when the string is no longer required. This pointer points to a MOF syntax rendering of the object upon return from the call. Because this is an out parameter, the pointer must not point to a string that is valid before this method is called, because the pointer will not be deallocated.

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

An unspecified error has occurred.

WBEM_E_INVALID_PARAMETER

A specified parameter is not valid.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the operation.

WBEM_S_NO_ERROR

The call succeeded.

 

Remarks

The following algorithm is used to reconstruct the text of the parameters of a method:

  1. Parameters are resequenced in the order of their identifier values.
  2. Parameters that are specified as [in] and [out] will be combined into a single parameter.

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
IWbemQualifierSet

 

 

Show:
© 2015 Microsoft