将显示文本的硬件设备上下文的字符的边界 (HDC),数字和输出指针 pText 参数的长度。返回一个表示文本范围的 windows 结构。
命名空间: Microsoft.VisualStudio.Shell.Interop
程序集: Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)
语法
声明
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
)
参数
- hdc
类型:System.UInt32
[in] 为 long 类型的指针硬件设备上下文 (HDC)。
- cch
类型:System.Int32
[in] 字符数或 -1,则 null 终止。
- pText
类型:array<System.UInt16[]
[in] 一个表示文本的 OLE 字符串。
- pSize
类型:array<Microsoft.VisualStudio.OLE.Interop.SIZE[]
[in] OLE 字符串的长度。
返回值
类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。
备注
COM 签名
从 vsshell.idl:
HRESULT IVsTextOut::VsGetTextExtent(
[in] DWORD_PTR hdc,
[in] int cch,
[in, size_is(cch)] LPCOLESTR pText
);
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。