Udostępnij za pośrednictwem


ViewFilter.IOleCommandTarget.QueryStatus Method

Definition

Determines if the specified commands in the given command group are supported.

 virtual int Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus(Guid % guidCmdGroup, System::UInt32 cCmds, cli::array <Microsoft::VisualStudio::OLE::Interop::OLECMD> ^ prgCmds, IntPtr pCmdText) = Microsoft::VisualStudio::OLE::Interop::IOleCommandTarget::QueryStatus;
int IOleCommandTarget.QueryStatus (ref Guid guidCmdGroup, uint cCmds, Microsoft.VisualStudio.OLE.Interop.OLECMD[] prgCmds, IntPtr pCmdText);
abstract member Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus : Guid * uint32 * Microsoft.VisualStudio.OLE.Interop.OLECMD[] * nativeint -> int
override this.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus : Guid * uint32 * Microsoft.VisualStudio.OLE.Interop.OLECMD[] * nativeint -> int
Function QueryStatus (ByRef guidCmdGroup As Guid, cCmds As UInteger, prgCmds As OLECMD(), pCmdText As IntPtr) As Integer Implements IOleCommandTarget.QueryStatus

Parameters

guidCmdGroup
Guid

[in] The GUID of the command group.

cCmds
UInt32

[in] The number of command IDs listed in the prgCmds array.

prgCmds
OLECMD[]

[in, out] An array of OLECMD structures that specify the command IDs being queried about. On return, the enable status of each command is stored in each structure.

pCmdText
IntPtr

nativeint

[in, out] An umarshaled pointer to an OLECMDTEXT structure that receives the name for each command that is supported.

Returns

If successful, returns S_OK; otherwise, returns an error code. A typical error code that can be returned is OLECMDERR_E_UNKNOWNGROUP, indicating the command group is not supported.

Implements

Remarks

This method is called to get the support status of all commands in the list for the specified command group. This information is used to enable or disable menu options and to determine what commands should be passed to the Exec method on the IOleCommandTarget interface (although Exec should make its own check for support as well).

This method is an implementation of the QueryStatus method on the IOleCommandTarget interface.

The base method calls the QueryCommandStatus method for each command in the list and stores the result in the OLECMD structure for that command. If QueryCommandStatus returns an error (such as OLECMDERR_E_UNKNOWNGROUP), then the base method calls the QueryStatus method on the next command target in the chain and returns the result immediately, skipping all remaining commands in the list (this means that the QueryCommandStatus method must report a valid status (supported or not supported) for all commands given to it unless the entire group is unsupported in which case QueryCommandStatus returns OLECMDERR_E_UNKNOWNGROUP). The base method does not set the command name in the pCmdText structure since the default managed package framework's implementation of the language service classes does not need to change the name of any existing command.

Applies to