Share via


IVsTextOut.VsGetTextExtent Method

Gets the extent of text's Hardware Device Context (HDC), number of characters, and outputs a pointer to the length of the pText parameter. Returns a Windows structure that represents the size of the text.

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

Syntax

'Declaration
Function VsGetTextExtent ( _
    hdc As UInteger, _
    cch As Integer, _
    pText As UShort(), _
    <OutAttribute> pSize As SIZE() _
) As Integer
int VsGetTextExtent(
    uint hdc,
    int cch,
    ushort[] pText,
    SIZE[] pSize
)
int VsGetTextExtent(
    [InAttribute] unsigned int hdc, 
    [InAttribute] int cch, 
    [InAttribute] array<unsigned short>^ pText, 
    [OutAttribute] array<SIZE>^ pSize
)
abstract VsGetTextExtent : 
        hdc:uint32 * 
        cch:int * 
        pText:uint16[] * 
        pSize:SIZE[] byref -> int
function VsGetTextExtent(
    hdc : uint, 
    cch : int, 
    pText : ushort[], 
    pSize : SIZE[]
) : int

Parameters

  • hdc
    Type: System.UInt32

    [in] Pointer to a long type to a hardware device context (HDC).

  • cch
    Type: System.Int32

    [in] Number of characters, or -1 if null-terminated.

  • pText
    Type: array<System.UInt16[]

    [in] OLE String that represents the 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 vsshell.idl:

HRESULT IVsTextOut::VsGetTextExtent(
   [in] DWORD_PTR hdc, 
   [in] int cch, 
   [in, size_is(cch)] LPCOLESTR pText
);

.NET Framework Security

See Also

Reference

IVsTextOut Interface

Microsoft.VisualStudio.Shell.Interop Namespace