WindowsRuntimeMarshal.StringToHString(String) 方法
定义
public:
static IntPtr StringToHString(System::String ^ s);
[System.Security.SecurityCritical]
public static IntPtr StringToHString (string s);
public static IntPtr StringToHString (string s);
[<System.Security.SecurityCritical>]
static member StringToHString : string -> nativeint
static member StringToHString : string -> nativeint
Public Shared Function StringToHString (s As String) As IntPtr
参数
- s
- String
要复制的托管字符串。The managed string to copy.
返回
一个指向新 HSTRING 的非托管指针;如果 s 为 Empty,则为 Zero。An unmanaged pointer to the new HSTRING, or Zero if s is Empty.
- 属性
例外
当前版本的操作系统不支持 Windows 运行时。The Windows Runtime is not supported on the current version of the operating system.
s 为 null。s is null.
注解
使用 FreeHString 方法在完成使用后释放 HSTRING 。Use the FreeHString method to release the HSTRING when you are done using it.