Copies the contents of a managed String object into native heap, converting into ASCII format on-the-fly. The method allocates the required, native heap memory.
[Visual Basic] Public Shared Function StringToHGlobalAnsi( _ ByVal s As String _ ) As Integer [C#] public static int StringToHGlobalAnsi( string s ); [C++] public: static int StringToHGlobalAnsi( String* s ); [JScript] public static function StringToHGlobalAnsi( 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