检索有关配置字符串的信息。调用包装到 ImmGetCompositionString。处理字符串为宽字符 (wchar_t) 而不是作为字节。
命名空间: Microsoft.VisualStudio.Shell.Interop
程序集: Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)
语法
声明
Function GetImmCompositionStringW ( _
HIMC As UInteger, _
dwIndex As UInteger, _
<OutAttribute> ByRef pbstrCompString As String, _
<OutAttribute> ByRef plRetVal As Integer _
) As Integer
int GetImmCompositionStringW(
uint HIMC,
uint dwIndex,
out string pbstrCompString,
out int plRetVal
)
参数
- HIMC
类型:System.UInt32
[in] 向 IME 上下文的句柄。
- dwIndex
类型:System.UInt32
[in] 检索信息的索引。有关可能的值的更多信息,请参见 IME 组合字符串值。
- pbstrCompString
类型:System.String%
[out] 宽字符 (wchar_t, Unicode) 缓冲区。使用 SysAllocStringByteLen 和 SysStringByteLen 管理此项目的内存。请参见 ImmSetCompositionString 和 ImmGetCompositionString。
- plRetVal
类型:System.Int32%
[out] 访问返回值的指针。在宽字符包含宽字符数复制到目标缓冲区; 或者,如果 dwBufLen 为零,缓冲区大小,,需要获取所有信息。该大小始终在宽字符。
在错误,将设置为两个值之一:IMM_ERROR_NODATA 或 IMM_ERROR_GENERAL。
返回值
类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。
备注
COM 签名
从 vsshell.idl:
HRESULT IVsIME::GetImmCompositionStringW(
[in] HIMC himc,
[in] DWORD dwIndex,
[out] BSTR *pbstrCompString,
[out] LONG * plRetVal
);
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。