OleMenuCommandService.IOleCommandTarget.QueryStatus Method

Definition

Sets command status.

 virtual int Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus(Guid % commandGroup, System::UInt32 nCmdId, cli::array <Microsoft::VisualStudio::OLE::Interop::OLECMD> ^ oleCmd, IntPtr oleText) = Microsoft::VisualStudio::OLE::Interop::IOleCommandTarget::QueryStatus;
int IOleCommandTarget.QueryStatus (ref Guid commandGroup, uint nCmdId, Microsoft.VisualStudio.OLE.Interop.OLECMD[] oleCmd, IntPtr oleText);
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 commandGroup As Guid, nCmdId As UInteger, oleCmd As OLECMD(), oleText As IntPtr) As Integer Implements IOleCommandTarget.QueryStatus

Parameters

commandGroup
Guid

System.Guid guidGroup. The menu group. This implementation maps the group to CommandID.Guid.

nCmdId
UInt32

System.UInt32 nCmdId. The ID code of the command. This implementation maps nCmdId to CommandID.ID.

oleCmd
OLECMD[]

Microsoft.OLE.Interop._tagOLECMD[] oleCmd. A command structure that contains data about the status of the command.

oleText
IntPtr

nativeint

System.IntPtr oleText. A pointer to a text BSTR. If the command is a verb the name of the verb will be filled in here.

Returns

An HRESULT code indicating the success or failure of the call. The following HRESULTs may be returned:ValueDescription S_OK The command was successfully invoked. OLECMDERR_E_UNKNOWNGROUP The group GUID did not match the commandID’s Guid property for any command or verb. OLECMDERR_E_NOTSUPPORTED The group was found, but there is no command or verb with an ID that matches. This is also returned if the OleStatus property of a command that was found returns zero.

Implements

Remarks

This method is defined as a private interface implementation for IOleCommandTarget. To make use of it, a tool or document window generally implements IOleCommandTarget itself, and then forwards calls to the implementation contained in MenuCommandService. This implementation of QueryStatus uses FindCommand if a command exists, and then sets oleCmd.cmdf to the status code returned by the command’s OleStatus property.

Applies to