IDebugPortEx2::LaunchSuspended

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Launches an executable file.

Syntax

HRESULT LaunchSuspended( 
   LPCOLESTR        pszExe,
   LPCOLESTR        pszArgs,
   LPCOLESTR        pszDir,
   BSTR             bstrEnv,
   DWORD            hStdInput,
   DWORD            hStdOutput,
   DWORD            hStdError,
   IDebugProcess2** ppPortProcess
);
int LaunchSuspended( 
   string             pszExe,
   string             pszArgs,
   string             pszDir,
   string             bstrEnv,
   uint               hStdInput,
   uint               hStdOutput,
   uint               hStdError,
   out IDebugProcess2 ppPortProcess
);

Parameters

pszExe
[in] The name of the executable to be launched. This can be a full path or relative to the working directory specified in the pszDir parameter.

pszArgs
[in] The arguments to pass to the executable. May be a null value if there are no arguments.

pszDir
[in] The name of the working directory used by the executable. May be a null value if no working directory is required.

bstrEnv
[in] Environment block of null-terminated strings, followed by an additional NULL terminator.

hStdInput
[in] Handle to an alternate input stream. May be 0 if redirection is not required.

hStdOutput
[in] Handle to an alternate output stream. May be 0 if redirection is not required.

hStdError
[in] Handle to an alternate error output stream. May be 0 if redirection is not required.

ppPortProcess
[out] Returns an IDebugPendingBreakpoint2 object that represents the launched process.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

This method should launch the process so that it is suspended and not running any code. The ResumeProcess method is called to resume the process.

A program can also be launched from a debug engine. For details, see Launching a Program.

See also