IVsLaunchPadFactory::CreateLaunchPad Method (IVsLaunchPad^)

 

Creates an IVsLaunchPad object that can be used to spawn command line tools and batch files.

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

int CreateLaunchPad(
	[OutAttribute] IVsLaunchPad^% ppLaunchPad
)

Parameters

ppLaunchPad
Type: Microsoft.VisualStudio.Shell.Interop::IVsLaunchPad^

[out] Pointer to a launch pad object.

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 IVsLaunchPadFactory::CreateLaunchPad(
   [out] IVsLaunchPad **ppLaunchPad
);

This method creates an IVsLaunchPad object that can be used to spawn command line tools and batch files. The IVsLaunchPad object handles the chores of piping output to the output window and of allowing the user to cancel. If the user cancels, it kills the spawned process.

Some project systems will use this functionality to implement StartBuild.

It is specifically possible to create an IVsLaunchPad object on a background builder thread. In order to do this, the project system should QueryService for the SVsLaunchPadFactory service from the main UI thread. It should pass the IVsLaunchPadFactory interface unmarshalled to their builder thread and then call IVsLaunchPadFactory::CreateLaunchPad from the builder thread in order to create the object on the builder thread.

System_CAPS_noteNote

This does slightly bend the marshalling rules of COM but is necessary to get the LaunchPad object created on the proper thread. The IVsLaunchPad object returned is an Apartment Model object.

Return to top
Show: