IOleCommandTarget::QueryStatus method

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

Syntax

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

Parameters

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.

cCmds

The number of commands in the prgCmds array.

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.

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

   
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