Copies the contents of a managed String object into native heap, converting into ASCII format on-the-fly if required. The method allocates the required, native heap memory.
[Visual Basic] Public Shared Function StringToHGlobalAuto( _ ByVal s As String _ ) As Integer [C#] public static int StringToHGlobalAuto( string s ); [C++] public: static int StringToHGlobalAuto( String* s ); [JScript] public static function StringToHGlobalAuto( s : String ) : int;
Address, in native heap, to where the string was copied.
Exception Type | Condition |
---|---|
System.Runtime.InteropServices.OutOfMemoryException | if the method could not allocate enough native heap memory. |
Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace