Click here to Skip to main content
15,887,436 members
Home / Discussions / C#
   

C#

 
AnswerRe: Finding a string variable in memory?? Pin
DaveyM6916-Oct-09 3:14
professionalDaveyM6916-Oct-09 3:14 
AnswerRe: Finding a string variable in memory?? Pin
Dave Kreskowiak16-Oct-09 5:07
mveDave Kreskowiak16-Oct-09 5:07 
On top of everything else that's been said, using managed code, C#, VB.NET, or any other language that targets the .NET Framework, an item can be moved in memory by the Garbage Collector at any time. So, even though you got the pointer to item, you really cannot use the pointer because the item might not be there anymore. The pointer you have will NOT get updated to reflect the new location in memory.

However, there is a way aroudn that. It's called "pinning". The GC can be told to pin an object in memory so it can't be moved. Read up on it here[^]. Be careful. When you pin an object, you are also responsible for removing the pin when you're done with it.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




Generali cannot find files Pin
Enobong Adahada15-Oct-09 21:45
Enobong Adahada15-Oct-09 21:45 
GeneralRe: i cannot find files Pin
Ashfield15-Oct-09 21:51
Ashfield15-Oct-09 21:51 
GeneralRe: i cannot find files Pin
benjymous16-Oct-09 0:31
benjymous16-Oct-09 0:31 
GeneralRe: i cannot find files Pin
Dave Kreskowiak16-Oct-09 4:59
mveDave Kreskowiak16-Oct-09 4:59 
QuestionHow to get rearm count Pin
AR Reddy15-Oct-09 21:21
AR Reddy15-Oct-09 21:21 
AnswerRe: How to get rearm count Pin
Zaegra15-Oct-09 21:52
Zaegra15-Oct-09 21:52 
AnswerRe: How to get rearm count Pin
Richard MacCutchan15-Oct-09 23:17
mveRichard MacCutchan15-Oct-09 23:17 
Questionaccess other system drive on LAN in .net Pin
220815-Oct-09 21:00
220815-Oct-09 21:00 
AnswerRe: access other system drive on LAN in .net Pin
Rajesh Anuhya15-Oct-09 21:44
professionalRajesh Anuhya15-Oct-09 21:44 
GeneralRe: access other system drive on LAN in .net [modified] Pin
220816-Oct-09 18:44
220816-Oct-09 18:44 
AnswerRe: access other system drive on LAN in .net Pin
Dave Kreskowiak16-Oct-09 4:58
mveDave Kreskowiak16-Oct-09 4:58 
GeneralRe: access other system drive on LAN in .net Pin
220816-Oct-09 16:27
220816-Oct-09 16:27 
GeneralRe: access other system drive on LAN in .net Pin
Dave Kreskowiak16-Oct-09 18:20
mveDave Kreskowiak16-Oct-09 18:20 
GeneralRe: access other system drive on LAN in .net Pin
220816-Oct-09 18:32
220816-Oct-09 18:32 
GeneralRe: access other system drive on LAN in .net Pin
Dave Kreskowiak17-Oct-09 5:40
mveDave Kreskowiak17-Oct-09 5:40 
QuestionCreating a setup for a project using c# Pin
Vinod T G15-Oct-09 20:01
Vinod T G15-Oct-09 20:01 
GeneralMaking .exe setup Pin
HEART2HACKER15-Oct-09 19:15
HEART2HACKER15-Oct-09 19:15 
GeneralRe: Making .exe setup Pin
Calla15-Oct-09 19:27
Calla15-Oct-09 19:27 
GeneralRe: Making .exe setup Pin
Abhijit Jana15-Oct-09 20:32
professionalAbhijit Jana15-Oct-09 20:32 
Questionhow do i get the duration of a video? Pin
thaiphu15-Oct-09 18:28
thaiphu15-Oct-09 18:28 
AnswerRe: how do i get the duration of a video? Pin
Christian Graus15-Oct-09 20:57
protectorChristian Graus15-Oct-09 20:57 
GeneralRe: how do i get the duration of a video? Pin
thaiphu15-Oct-09 21:58
thaiphu15-Oct-09 21:58 
QuestionVoip , SIP and ZRTP Pin
Mike Bond15-Oct-09 17:02
Mike Bond15-Oct-09 17:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.