NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Marshal.StringToHGlobalAnsi

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;

Parameters

s
Managed String object to be copied.

Return Value

Address, in native heap, to where the string was copied.

Exceptions

Exception Type Condition
System.Runtime.InteropServices.OutOfMemoryException if the method could not allocate enough native heap memory

See Also

Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace