Share via


IVsTextStream.GetStream Method

Provides direct, stream-oriented access to the text buffer.

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

Syntax

'Declaration
Function GetStream ( _
    iPos As Integer, _
    iLength As Integer, _
    pszDest As IntPtr _
) As Integer
int GetStream(
    int iPos,
    int iLength,
    IntPtr pszDest
)
int GetStream(
    [InAttribute] int iPos, 
    [InAttribute] int iLength, 
    [InAttribute] IntPtr pszDest
)
abstract GetStream : 
        iPos:int * 
        iLength:int * 
        pszDest:IntPtr -> int
function GetStream(
    iPos : int, 
    iLength : int, 
    pszDest : IntPtr
) : int

Parameters

  • iPos
    Type: System.Int32

    [in] Starting position in the text buffer

  • iLength
    Type: System.Int32

    [in] Length of the text stream to access. 

  • pszDest
    Type: System.IntPtr

    [in] The caller-allocated string buffer. This buffer is filled with the requested text.

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 textmgr.idl:

HRESULT IVsTextStream::GetStream(
   [in] long iPos,
   [in] long iLength,
   [out] WCHAR *pszDest
);

When using this method, be sure to allocate a buffer of size iLength+1, because this call appends a nulla null reference (Nothing in Visual Basic) to the character array.

.NET Framework Security

See Also

Reference

IVsTextStream Interface

Microsoft.VisualStudio.TextManager.Interop Namespace