WindowsRuntimeMarshal.PtrToStringHString Method

.NET Framework 4.6 and 4.5

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Returns a managed string that contains a copy of the specified Windows Runtime HSTRING.

Namespace:  System.Runtime.InteropServices.WindowsRuntime
Assemblies:   System.Runtime.InteropServices.WindowsRuntime (in System.Runtime.InteropServices.WindowsRuntime.dll)
  mscorlib (in mscorlib.dll)

public static string PtrToStringHString(
	IntPtr ptr
)

Parameters

ptr
Type: System.IntPtr

An unmanaged pointer to the HSTRING to copy.

Return Value

Type: System.String
A managed string that contains a copy of the HSTRING if ptr is not IntPtr.Zero; otherwise, String.Empty.

ExceptionCondition
PlatformNotSupportedException

The Windows Runtime is not supported on the current version of the operating system.

.NET Framework

Supported in: 4.6, 4.5

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft