IVsProjectStartupServices.RemoveStartupService Method

Removes a service ID GUID from the list of third party services to be started and releases the service if it has been loaded.

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

Syntax

'宣言
Function RemoveStartupService ( _
    ByRef guidService As Guid _
) As Integer
'使用
Dim instance As IVsProjectStartupServices
Dim guidService As Guid
Dim returnValue As Integer

returnValue = instance.RemoveStartupService(guidService)
int RemoveStartupService(
    ref Guid guidService
)
int RemoveStartupService(
    [InAttribute] Guid% guidService
)
function RemoveStartupService(
    guidService : Guid
) : int

Parameters

  • guidService
    Type: System.Guid%

    [in] GUID object specifying service.

Return Value

Type: System.Int32

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsProjectStartupServices::RemoveStartupService(
   [in] REFGUID guidService
);

On RemoveStartupService, you stop the service by releasing the pointer previously held, and remove the GUID from the list of startup service GUIDs persisted with your project file.

This functionality is not provided in HierUtil7's CVsHierarchy, which is the basis for Basic Project's CMyProjectHierarchy, so the interface is implemented in the Basic Project sample. The implementation of the above behavior in Basic Project is contained within a member variable to the hierarchy (m_projectStartupServices), which adds the code it takes to remember the services, and start/stop them. The m_projectStartupServices class member is implemented in CVsProjectStartupServices in the file VsProjectStartupServices.h/.cpp, which you can analyze to get an example of proper implementation.

Permissions

See Also

Reference

IVsProjectStartupServices Interface

IVsProjectStartupServices Members

Microsoft.VisualStudio.Shell.Interop Namespace