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.
Syntax
HRESULT GetResultString(
[in] LONG lTimeout,
[out] BSTR *pstrResultString
);
Parameters
- 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 table lists the value contained within an 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.
| Return code | Description |
|---|---|
|
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. |
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Header |
|
See also
Send comments about this topic to Microsoft
Build date: 11/19/2012