다음을 통해 공유


IVsSolution2.AdviseSolutionEvents(IVsSolutionEvents, UInt32) Method

Definition

Establishes client notification of solution events.

public:
 int AdviseSolutionEvents(Microsoft::VisualStudio::Shell::Interop::IVsSolutionEvents ^ pSink, [Runtime::InteropServices::Out] System::UInt32 % pdwCookie);
int AdviseSolutionEvents(Microsoft::VisualStudio::Shell::Interop::IVsSolutionEvents const & pSink, [Runtime::InteropServices::Out] unsigned int & pdwCookie);
public int AdviseSolutionEvents (Microsoft.VisualStudio.Shell.Interop.IVsSolutionEvents pSink, out uint pdwCookie);
abstract member AdviseSolutionEvents : Microsoft.VisualStudio.Shell.Interop.IVsSolutionEvents * uint32 -> int
Public Function AdviseSolutionEvents (pSink As IVsSolutionEvents, ByRef pdwCookie As UInteger) As Integer

Parameters

pSink
IVsSolutionEvents

[in] Pointer to the IVsSolutionEvents interface on the object requesting notification of solution events.

pdwCookie
UInt32

[out] Unique identifier for the referenced event sink. This value is required to unadvise the event sink using the UnadviseUpdateSolutionEvents(UInt32) method.

Returns

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

Implements

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSolution2::AdviseSolutionEvents(  
   [in] IVsSolutionEvents *pSink,   
   [out] VSCOOKIE *pdwCookie  
);  

Use this method to set up notification of solution events on a particular object by synchronizing the solution to the solution events. For example, the Output window contains some panes that provide information about the solution. These panes are closed when the solution is closed. Thus, when the solution close event is received, then the Output window clears the Build pane and the Debug Output pane. For another example, see OnAfterSave.

Applies to