Home All Groups Group Topic Archive Search About

ISynchronizeInvoke - Checking my understanding

Author
14 Oct 2005 6:03 AM
Wavemaker
According to the documentation, when the target method is invoked as a
result of a call to ISynchronizeInvoke.Invoke and an exception occurs,
the exception is propagated back to the caller. In testing this out with
a Windows Form, I've found this to be the case.

However, how ISynchronizeInvoke.BeginInvoke handles exceptions isn't
explained, or I haven't found an explanation in the documents.

In testing a Windows Form, I've found that if you call
ISynchronizeInvoke.EndInvoke, you can catch an exception thrown from the
target method. In addition, it appears that the exception is also throw
as an unhanded exception at the point of invocation. The logic appears
to be that with ISynchronizeInvoke.Invoke, it is known that the caller
is waiting for the results, so propagating the exception to the caller
is enough. It is not known (I think) if the caller has called
ISynchronizeInvoke.EndInvoke from the point of invocation, so just to
make sure that the exception is not lost, it is rethrown from there.

This is all based on my impressions having tested out a Windows Form
object. Is there documentation any where that goes into more detail
about ISynchronizeInvoke and possibly corrects any misunderstanding I
may have of how it is suppose to work?

AddThis Social Bookmark Button