R
Rohit Kumbhar
Hi,
I am writing a Windows Forms C# application [I am new to C#] for reading
files on the disk. My problem is the UI freezes when restored after
being minimized for a long time [20-30 minutes].
I have a separate thread which does the reading and updates the UI [two
datagridviews, two labels and a button control]. I ran against the cross
thread UI calls when debugging and corrected the error by using
delegates and "InvokeRequired" property.
Running the application in Debug mode and checking for cross thread call
exception is the test I am using for checking this.
Another issue that I am facing is the dieing/killing of the reading
thread. No exceptions. No event logs. The thread just dies, I can't
understand why. The UI freeze and thread dying usually happen together.
I am doing GC.Collect(), Application.DoEvents() and Thread.Sleep(200)
after every file read and processed. For a try, I wrote the handler for
GotFocus event of the form to explicitly invalidate the controls.
Doesn't help.
My biggest problem is all this happens randomly, not for a particular
file or file type.
Using .NET version 2.0 with the latest updates.
What am I missing?
Regards
Rohit
I am writing a Windows Forms C# application [I am new to C#] for reading
files on the disk. My problem is the UI freezes when restored after
being minimized for a long time [20-30 minutes].
I have a separate thread which does the reading and updates the UI [two
datagridviews, two labels and a button control]. I ran against the cross
thread UI calls when debugging and corrected the error by using
delegates and "InvokeRequired" property.
Running the application in Debug mode and checking for cross thread call
exception is the test I am using for checking this.
Another issue that I am facing is the dieing/killing of the reading
thread. No exceptions. No event logs. The thread just dies, I can't
understand why. The UI freeze and thread dying usually happen together.
I am doing GC.Collect(), Application.DoEvents() and Thread.Sleep(200)
after every file read and processed. For a try, I wrote the handler for
GotFocus event of the form to explicitly invalidate the controls.
Doesn't help.
My biggest problem is all this happens randomly, not for a particular
file or file type.
Using .NET version 2.0 with the latest updates.
What am I missing?
Regards
Rohit