Hi,
I have a few related questios:
1. if I pass a string to win32 api (or other dll not written in .net), is it
possible GC cleans up while function is still busy ? eg:
public class Win32
{
[DllImport("User32.dll")]
public static extern IntPtr FindWindow(string ClassName, string
WindowName);
And call it:
IntPtr Win = Win32.FindWindow(ClassName, null);
2. Does it make a difference if ClassName is a literal inside the exe,
because in that case the string is only a pointer to something in read only
mem, so no memory allocation, eg:
string ClassName = "theclass";
IntPtr Win = Win32.FindWindow(ClassName, null);
3. Is it possible to block the GC for a while, for example if I have time
critical code to execute, I dont want to let GC slow down machine if there is
a lot to clean up ?
--
rgds, Wilfried
http://www.mestdagh.biz