IVsUIShell::PostExecCommand Method (Guid, UInt32, UInt32, Object^)

 

Allows asynchronous execution of commands.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

int PostExecCommand(
	[InAttribute] Guid% pguidCmdGroup,
	unsigned int nCmdID,
	unsigned int nCmdexecopt,
	[InAttribute] Object^% pvaIn
)

Parameters

pguidCmdGroup
Type: System::Guid

[in, unique] Unique identifier of the command group; can be null to specify the standard group. All the commands that are passed in the nCmdID must belong to the group specified by pguidCmdGroup.

nCmdID
Type: System::UInt32

[in] The command to be executed. This command must belong to the group specified with pguidCmdGroup.

nCmdexecopt
Type: System::UInt32

[in] Values describe how the object should execute the command.

pvaIn
Type: System::Object^

[in, unique] Pointer to a VARIANTARG structure containing input arguments. Can be null.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From vsshell.idl:

HRESULT IVsUIShell::PostExecCommand(
   [in, unique] const GUID * pguidCmdGroup,
   [in] DWORD nCmdID,
   [in] DWORD nCmdexecopt,
   [in, unique] VARIANT * pvaIn
);

To synchronously execute a command, call QueryService for the SID_SUIHostCommandDispatcher service, which returns an object that implements IOleCommandTarget. In this case, the environment synchronously executes the command and return. Use IVsUIShell.PostExecCommand method to asynchronously execute a command. That is, the command is posted to the environment, but control is returned to you immediately. The command then executes at a later time.

Return to top
Show: