GCHandleExtensions.GetAddressOfStringData Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.