J
James
Hi,
I have a windows form and a class. A method of the class
returns a data view object which the form binds to a
control. The data can be refreshed by clicking a refresh
button or waiting for a timer on the form to expire. Both
methods call the same function on the class. I have
recently developed a problem where it appears that when
both events occur and try to access the funtion on the
class at the same time the app blows up. How can I ensure
that the function is only called by one place at a time?
I tried using a mutex (created it in the class, called
the waitone function at the beginging of the function and
release just before the return) but the app not only
crashes with this approach, it hangs after the crash.
I would appreciate any help. Thanks!
I have a windows form and a class. A method of the class
returns a data view object which the form binds to a
control. The data can be refreshed by clicking a refresh
button or waiting for a timer on the form to expire. Both
methods call the same function on the class. I have
recently developed a problem where it appears that when
both events occur and try to access the funtion on the
class at the same time the app blows up. How can I ensure
that the function is only called by one place at a time?
I tried using a mutex (created it in the class, called
the waitone function at the beginging of the function and
release just before the return) but the app not only
crashes with this approach, it hangs after the crash.
I would appreciate any help. Thanks!