IWbemCallResult::GetResultString method

The IWbemCallResult::GetResultString method returns the assigned object path of an instance newly created by IWbemServices::PutInstance.

Note  The call result object is primarily used when the PutInstance call is carried out by a provider and the client needs to know the object path (the values of the key properties) assigned the provider. For example, if the class key property is a globally unique identifier (GUID), assigned by the provider during the PutInstance operation, the client would have no way of knowing this GUID unless the provider was able to return it in this way.


HRESULT GetResultString(
  [in]  LONG lTimeout,
  [out] BSTR *pstrResultString


lTimeout [in]

Specifies the maximum time in milliseconds that this call blocks before returning. If you use the constant WBEM_INFINITE (0xFFFFFFFF), the call blocks until the object path is available. If you use 0, the call immediately returns either the object path or a status code.

pstrResultString [out]

Cannot be NULL. This parameter receives a pointer to the object path, which, in turn, leads to the newly created object. The returned string must be deallocated using the system call SysFreeString. On error, a new string is not returned.

Return value

This method returns an HRESULT indicating the status of the method call. The following list lists the value contained withinan HRESULT.

On error, you can call the COM function GetErrorInfo to obtain more error information.

COM-specific error codes may also be returned if network problems cause you to lose the remote connection to Windows Management.


The object path was retrieved.


The object was not yet available before the lTimeout value expired.


An internal failure occurred.


This indicates the failure of the remote procedure call (RPC) link between the current process and Windows Management.


The caller attempted an unauthorized operation.


A specified parameter is not valid.


There was not enough memory to complete the operation.


An unspecified error occurred.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008


Wbemcli.h (include Wbemidl.h)

See also