ViewFilter.QueryCommandStatus(Guid, UInt32) Method

Definition

Override this method to intercept the IOleCommandTarget::QueryStatus call.

protected:
 virtual int QueryCommandStatus(Guid % guidCmdGroup, System::UInt32 nCmdId);
protected virtual int QueryCommandStatus (ref Guid guidCmdGroup, uint nCmdId);
abstract member QueryCommandStatus : Guid * uint32 -> int
override this.QueryCommandStatus : Guid * uint32 -> int
Protected Overridable Function QueryCommandStatus (ByRef guidCmdGroup As Guid, nCmdId As UInteger) As Integer

Parameters

guidCmdGroup
Guid
nCmdId
UInt32

Returns

Usually returns a combination of OLECMDF flags, for example OLECMDF_ENABLED | OLECMDF_SUPPORTED.
Return E_FAIL if want to delegate to the next command target.

Remarks

If your language service supports additional commands than those supported by the ViewFilter class, then you must derive a class from the ViewFilter class and override this method. Determine if your commands are supported first and then call the base method if the command is unrecognized.

The base method obtains the expansion provider and if a template is currently being edited, calls the HandleQueryStatus method on the ExpansionProvider class. If HandleQueryStatus returns true, then the base method returns the code from HandleQueryStatus. Otherwise, the base method reports that all the commands supported by the base ViewFilter class are supported — if certain conditions apply (see the command table below). The base method returns OLECMDERR_E_UNKNOWNGROUP if a command is not supported.

The following table lists the commands and the properties that must be set for the command to be supported.

Command Condition for support
AUTOCOMPLETE Always
COMMENTBLOCK EnableCommenting = true
COMPLETEWORD Always
FORMATDOCUMENT CanReformat = true
FORMATSELECTION CanReformat = true
GotoDecl Always
GotoDefn Always
GotoRef Always
OUTLN_START_AUTOHIDING OutliningEnabled = true
PARAMINFO Always
QUICKINFO EnableQuickInfo = true
SHOWMEMBERLIST Always
UNCOMMENTBLOCK EnableCommenting = true

Applies to