|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to pin object so the gc will not move it in memory ?im allocating an object that is a wrapper of unmanaged code.
how can i pin that object in memory ,so the gc will not move it. the reason is some other data members of the object,are sent to unmanaged code. hope im clear "roni" <ronix***@hotmail.com> schrieb: Take a look at 'GCHandle.Alloc' + 'GCHandleType.Pinned'.> im allocating an object that is a wrapper of unmanaged code. > > how can i pin that object in memory ,so the gc will not move it. > > the reason is some other data members of the object,are sent to unmanaged > code. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> >the reason is some other data members of the object,are sent to unmanaged Note that the runtime will pin arguments you pass to native code for>code. the duration of the call, so you only have to do it manually (the way Herfried suggested) if the object must remain pinned after the call returns. Mattias -- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
2D array of string
Equivalent to Mid function but read from right of the string Opening a browser from vb.net from need clarification from M S Herfried K. Wagner 2GB memory limit Help using Right() string function? Bitmap and MemoryStream Command Line Compiling with license file How to set the default value of a date picker to nothing (blank) Datagrid Question |
|||||||||||||||||||||||