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
'宣言
Function VsGetTextExtent ( _
hdc As UInteger, _
cch As Integer, _
pText As UShort(), _
<OutAttribute> pSize As SIZE() _
) As Integer
'使用
Dim instance As IVsTextOut
Dim hdc As UInteger
Dim cch As Integer
Dim pText As UShort()
Dim pSize As SIZE()
Dim returnValue As Integer
returnValue = instance.VsGetTextExtent(hdc, _
cch, pText, pSize)
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
)
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: [][in] OLE String that represents the text.
pSize
Type: [][in] Length of the OLE String.
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
);
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.