Edit

Share via


GCHandleExtensions.GetAddressOfStringData Method

Definition

Important

This API is not CLS-compliant.

Retrieves the address of the string data in handle.

public:
[System::Runtime::CompilerServices::Extension]
 static char* GetAddressOfStringData(System::Runtime::InteropServices::PinnedGCHandle<System::String ^> handle);
[System.CLSCompliant(false)]
public static char* GetAddressOfStringData(this System.Runtime.InteropServices.PinnedGCHandle<string> handle);
[<System.CLSCompliant(false)>]
static member GetAddressOfStringData : System.Runtime.InteropServices.PinnedGCHandle<string> -> nativeptr<char>

Parameters

handle
PinnedGCHandle<String>

The handle to retrieve the pointer from.

Returns

Char*

The address of the 0th character of the pinned String, or null if the handle doesn't point to any object.

Attributes

Exceptions

The handle is not initialized or is already disposed.

Applies to