B
Brett Robichaud
I have created a simple background thread to make one pinvoke call into a
DLL I've created. My Winforms app spawns the thread in the form load event
then go about it's business. The problem is that my form appears to be
blocked while the background thread is running.
I am very familir with threads in unmanaged code but am just getting into
them in C#. Are there issues I need to be aware of with regards to
threading a simple pinvoke call?
As an experiment I replaced my pinvoke call with a simple
Thread.Sleep(5000). This gave me the result I expected, my UI was
responsive during the entire 5 seconds the thread was waiting. Changing the
wait back into a pinvoke call caused my UI to not redraw until the pinvoke
call completed.
Any idea what's up?
-Brett-
DLL I've created. My Winforms app spawns the thread in the form load event
then go about it's business. The problem is that my form appears to be
blocked while the background thread is running.
I am very familir with threads in unmanaged code but am just getting into
them in C#. Are there issues I need to be aware of with regards to
threading a simple pinvoke call?
As an experiment I replaced my pinvoke call with a simple
Thread.Sleep(5000). This gave me the result I expected, my UI was
responsive during the entire 5 seconds the thread was waiting. Changing the
wait back into a pinvoke call caused my UI to not redraw until the pinvoke
call completed.
Any idea what's up?
-Brett-