共用方式為


IVsTextManager.RegisterBuffer(IVsTextBuffer) Method

Definition

Registers a text buffer with the text manager.

public:
 int RegisterBuffer(Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer ^ pBuffer);
public:
 int RegisterBuffer(Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer ^ pBuffer);
int RegisterBuffer(Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer const & pBuffer);
public int RegisterBuffer (Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer pBuffer);
abstract member RegisterBuffer : Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer -> int
Public Function RegisterBuffer (pBuffer As IVsTextBuffer) As Integer

Parameters

pBuffer
IVsTextBuffer

[in] Pointer to the IVsTextBuffer interface to register.

Returns

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

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsTextManager::RegisterBuffer(  
   [in] IVsTextBuffer *pBuffer  
);  

Use this method to register a text buffer that is created externally. All buffers must register with the text manager service to receive messages, such as change notifications.

Note

To avoid circular reference problems, UnregisterBuffer should be called from the buffer's implementation of the interface Close, which is called from the running document table.

Applies to