PDA

View Full Version : QApplication::notify()



jeffpogo
16th June 2009, 19:58
Can someone post an example that will handle exceptions thrown from a windows event handler? (from a dll function)

I get the following message:

Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

Thank you, Jeff.

jeffpogo
16th June 2009, 22:46
I answer my own question: (wrap the dll function call in the try/catch)

If someone has a better or Qt way, please let me know. I have yet to find an good example of the winEventFilter or winEvent function override method.

Thanks!



try {
mp_TwainPRO->OpenSession();
}
catch (_com_error &e) {
handleError(e);
return;
}