IOleCommandTarget::QueryStatus method (docobj.h)

Queries the object for the status of one or more commands generated by user interface events.

Syntax

HRESULT QueryStatus(
  [in]      const GUID *pguidCmdGroup,
  [in]      ULONG      cCmds,
  [in, out] OLECMD []  prgCmds,
  [in, out] OLECMDTEXT *pCmdText
);

Parameters

[in] pguidCmdGroup

The unique identifier of the command group; can be NULL to specify the standard group. All the commands that are passed in the prgCmds array must belong to the group specified by pguidCmdGroup.

[in] cCmds

The number of commands in the prgCmds array.

[in, out] prgCmds

A caller-allocated array of OLECMD structures that indicate the commands for which the caller needs status information. This method fills the cmdf member of each structure with values taken from the OLECMDF enumeration.

[in, out] pCmdText

A pointer to an OLECMDTEXT structure in which to return name and/or status information of a single command. This parameter can be NULL to indicate that the caller does not need this information.

Return value

This method returns S_OK on success. Other possible return values include the following.

Return code Description
E_FAIL
The operation failed.
E_UNEXPECTED
An unexpected error has occurred.
E_POINTER
The prgCmds argument is NULL.
OLECMDERR_E_UNKNOWNGROUP
The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.

Remarks

Callers use QueryStatus to determine which commands are supported by a target object. The caller can then disable unavailable commands that would otherwise be routed to the object. The caller can also use this method to get the name or status of a single command.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header docobj.h

See also

IOleCommandTarget

OLECMD

OLECMDF

OLECMDTEXT