共用方式為


IVsProjectStartupServices.RemoveStartupService(Guid) Method

Definition

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

public:
 int RemoveStartupService(Guid % guidService);
public int RemoveStartupService (ref Guid guidService);
abstract member RemoveStartupService : Guid -> int
Public Function RemoveStartupService (ByRef guidService As Guid) As Integer

Parameters

guidService
Guid

[in] GUID object specifying service.

Returns

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.

Applies to