Partager via


IVsTextStream.CreateStreamMarker Method

Definition

Creates a stream marker of a given type over the specified region.

public:
 int CreateStreamMarker(int iMarkerType, int iPos, int iLength, Microsoft::VisualStudio::TextManager::Interop::IVsTextMarkerClient ^ pClient, cli::array <Microsoft::VisualStudio::TextManager::Interop::IVsTextStreamMarker ^> ^ ppMarker);
public:
 int CreateStreamMarker(int iMarkerType, int iPos, int iLength, Microsoft::VisualStudio::TextManager::Interop::IVsTextMarkerClient ^ pClient, Platform::Array <Microsoft::VisualStudio::TextManager::Interop::IVsTextStreamMarker ^> ^ ppMarker);
int CreateStreamMarker(int iMarkerType, int iPos, int iLength, Microsoft::VisualStudio::TextManager::Interop::IVsTextMarkerClient const & pClient, std::Array <Microsoft::VisualStudio::TextManager::Interop::IVsTextStreamMarker const &> const & ppMarker);
public int CreateStreamMarker (int iMarkerType, int iPos, int iLength, Microsoft.VisualStudio.TextManager.Interop.IVsTextMarkerClient pClient, Microsoft.VisualStudio.TextManager.Interop.IVsTextStreamMarker[] ppMarker);
abstract member CreateStreamMarker : int * int * int * Microsoft.VisualStudio.TextManager.Interop.IVsTextMarkerClient * Microsoft.VisualStudio.TextManager.Interop.IVsTextStreamMarker[] -> int
Public Function CreateStreamMarker (iMarkerType As Integer, iPos As Integer, iLength As Integer, pClient As IVsTextMarkerClient, ppMarker As IVsTextStreamMarker()) As Integer

Parameters

iMarkerType
Int32

[in] Type of marker to create.

iPos
Int32

[in] Starting position in the text buffer.

iLength
Int32

[in] Length of text to create marker over.

pClient
IVsTextMarkerClient

[in] Pointer to the IVsTextMarkerClient interface. Implement this interface to advise the text buffer that you want to receive notification of marker events.

ppMarker
IVsTextStreamMarker[]

[out] Pointer to the IVsTextStreamMarker interface. If this parameter is null, then the text marker is owned by the text buffer. An example of a buffer-owned text marker is a temporary bookmark.

Returns

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

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsTextStream::CreateStreamMarker(  
   [in] long iMarkerType,  
   [in] long iPos,  
   [in] long iLength,  
   [in] IVsTextMarkerClient *pClient,  
   [out] IVsTextStreamMarker **ppMarker  
);  

This method creates a marker over the specified region. If you want to listen to marker events for the buffer, then pass in a pointer to the IVsTextMarkerClient interface in the pClient parameter.

Note

The markers created using CreateStreamMarker are stream-oriented markers. Use M:Microsoft.VisualStudio.TextManager.Interop.IVsTextLines.CreateLineMarker(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,Microsoft.VisualStudio.TextManager.Interop.IVsTextMarkerClient,Microsoft.VisualStudio.TextManager.Interop.IVsTextLineMarker[]) to create line-oriented markers.

Applies to