Copies the contents of a string to a block of memory allocated from the unmanaged COM task allocator. The characters of the string are copied as either ANSI or Unicode characters, depending on the operating system where the code is executing. On Windows 95 or Windows 98, the characters are copied as ANSI characters. On Windows NT 4.0 or Windows 2000, the characters are copied as Unicode characters.
[Visual Basic] Public Shared Function StringToCoTaskMemAuto( _ ByVal s As String _ ) As Integer [C#] public static int StringToCoTaskMemAuto( string s ); [C++] public: static int StringToCoTaskMemAuto( String* s ); [JScript] public static function StringToCoTaskMemAuto( s : String ) : int;
Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace