S
Steven Spencer \(Spinalogic\)
Gday,
I'm a java developer turned .net developer, and I'm unfamiliar with some
concepts, especially the event loop.
We have a form in which upon closing needs to save a significant amount of
data, and perform some thread cleanup etc for long running tasks. We have
added a handler to the "closing" event on the form to do this. Occasionally
on exiting the form (not shown modally) we end up with our dataset (which is
perfectly accessed up to two or three times before) coming up with a null
reference exception. What I wanted to know is how the event handler works?
Does it wait for all registered handlers of the event to execute and THEN
dispose the form? Or does it simply dispose at some point after calling the
closing method.
IF someone knew a good tute to understand the message loop on the winforms,
that would be great too.
PS forgive me if this is a primitive question.
I'm a java developer turned .net developer, and I'm unfamiliar with some
concepts, especially the event loop.
We have a form in which upon closing needs to save a significant amount of
data, and perform some thread cleanup etc for long running tasks. We have
added a handler to the "closing" event on the form to do this. Occasionally
on exiting the form (not shown modally) we end up with our dataset (which is
perfectly accessed up to two or three times before) coming up with a null
reference exception. What I wanted to know is how the event handler works?
Does it wait for all registered handlers of the event to execute and THEN
dispose the form? Or does it simply dispose at some point after calling the
closing method.
IF someone knew a good tute to understand the message loop on the winforms,
that would be great too.
PS forgive me if this is a primitive question.