Allocates memory from the process' unmanaged, native, heap.
[Visual Basic] Public Shared Function AllocHGlobal( _ ByVal cb As Integer _ ) As Integer [C#] public static int AllocHGlobal( int cb ); [C++] public: static int AllocHGlobal( int cb ); [JScript] public static function AllocHGlobal( cb : int ) : int;
A pointer to the newly allocated memory. Treat this as a void* and cast as appropriate.
Exception Type | Condition |
---|---|
System.Runtime.InteropServices.OutOfMemoryException | if there is insufficient memory to satisfy the request. |
Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace