Parse method
Collapse the table of content
Expand the table of content

IWbemQuery::Parse method

The IWbemQuery::Parse method parses a query string.

Syntax


HRESULT Parse(
  [in] LPCWSTR pszLang,
  [in] LPCWSTR pszQuery,
  [in] ULONG   uFlags
);

Parameters

pszLang [in]

Language of the query. Must be either "WQL" or "SQL" (case-sensitive). Any other value will result in the method failing and WBEM_E_INVALID_PARAMETER being returned.

pszQuery [in]

Valid WQL or SQL WMI query.

uFlags [in]

Reserved for future use. Must be 0 (zero).

Return value

This method returns an HRESULT indicating the status of the method call.

Return codeDescription
WBEM_S_NO_ERROR

The method was successful.

WBEM_E_INVALID_PARAMETER

One of the parameters to the call was not correct.

WBEM_E_INVALID_SYNTAX

The query was not syntactically valid.

 

Examples

The following code example shows the use of IWbemQuery::Parse.



IWbemQuery *pQuery = NULL;
HRESULT hr = NULL;
hr = CoCreateInstance(CLSID_WbemQuery,
                      0,
                      CLSCTX_INPROC_SERVER,
                      IID_IWbemQuery,
                      (LPVOID *)&pQuery);


hr = pQuery->Parse(L"WQL",
                   L"SELECT * FROM Win32_LogicalDisk WHERE FreeSpace < 4000000L",
                   0);

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wmiutils.h

Library

Wbemuuid.lib

DLL

Wmiutils.dll

See also

IWbemQuery

 

 

Show:
© 2016 Microsoft