IVsLaunchPad::ExecCommand Method (String^, String^, String^, UInt32, IVsOutputWindowPane^, UInt32, UInt32, String^, IVsLaunchPadEvents^, UInt32, array<String^>^)
Executes a command with output piped to an output pane in the IDE.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int ExecCommand( String^ pszApplicationName, String^ pszCommandLine, String^ pszWorkingDir, unsigned int lpf, IVsOutputWindowPane^ pOutputWindowPane, unsigned int nTaskItemCategory, unsigned int nTaskItemBitmap, String^ pszTaskListSubcategory, IVsLaunchPadEvents^ pVsLaunchPadEvents, [OutAttribute] unsigned int% pdwProcessExitCode, array<String^>^ pbstrOutput )
Parameters
- pszApplicationName
-
Type:
System::String^
[in] Application name that is passed to CreateProcess by the environment. For more information, see CreateProcess.
- pszCommandLine
-
Type:
System::String^
[in] Command line string that is passed to CreateProcess by the environment.
- pszWorkingDir
-
Type:
System::String^
[in] Working directory that is passed to CreateProcess by the environment. Can be null.
- lpf
-
Type:
System::UInt32
[in] Launch pad flags. Values are taken from the _LAUNCHPAD_FLAGS enumeration.
- pOutputWindowPane
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsOutputWindowPane^
[in] Pointer to the IVsOutputWindowPane interface created by CreatePane.
- nTaskItemCategory
-
Type:
System::UInt32
[in] Task item category, if lpf is set to LPF_PipeStdoutToTaskList. Values are taken from the VSTASKCATEGORY enumeration.
- nTaskItemBitmap
-
Type:
System::UInt32
[in] Task item bitmap, if lpf is set to LPF_PipeStdoutToTaskList.
- pszTaskListSubcategory
-
Type:
System::String^
[in] Task list subcategory, if lpf is set to LPF_PipeStdoutToTaskList.
- pVsLaunchPadEvents
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsLaunchPadEvents^
[in] Pointer to the IVsLaunchPadEvents interface.
- pdwProcessExitCode
-
Type:
System::UInt32
[out] Value returned by process.
- pbstrOutput
-
Type:
array<System::String^>^
[out] true if all output was generated. Can be null.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsLaunchPad::ExecCommand( [in] LPCOLESTR pszApplicationName, [in] LPCOLESTR pszCommandLine, [in] LPCOLESTR pszWorkingDir, [in] LAUNCHPAD_FLAGS lpf, [in] IVsOutputWindowPane *pOutputWindowPane, [in] ULONG nTaskItemCategory, [in] ULONG nTaskItemBitmap, [in] LPCOLESTR pszTaskListSubcategory, [in] IVsLaunchPadEvents *pVsLaunchPadEvents, [out] DWORD *pdwProcessExitCode, [out] BSTR *pbstrOutput );
If ExecBatchScript is called with lpf set to LPF_PipeStdoutToOutputWindow | LPF_PipeStdoutToTaskList, ExecBatchScript internally calls ParseOutputStringForTaskItem. This means that any output generated by pszApplicationName must meet the format requirements of ParseOutputStringForTaskItem.