Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Marshal Class
Marshal Methods

  Switch on low bandwidth view
Members FilterMembers Filter
Frameworks FilterFrameworks Filter
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Marshal..::.AllocHGlobal Method

Allocates a block of memory using LocalAlloc.

  NameDescription
Public methodStatic memberSupported by the .NET Compact FrameworkAllocHGlobal(Int32)Allocates memory from the unmanaged memory of the process.
Public methodStatic memberAllocHGlobal(IntPtr)Allocates memory from the process's unmanaged memory.
Top
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Marshalling: Using native DLLs in .NET      rednael   |   Edit   |   Show History

Please read the following article:
http://blog.rednael.com/2008/08/29/MarshallingUsingNativeDLLsInNET.aspx


It's an in-depth article about how to use a native DLL (or C++ DLL) in your managed .Net code. The article shows which types are interoperable, how to import a DLL, how to pass strings, how to pass structures and how to de-reference pointers.


And C# source code examples are included.

Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker