Results 1 to 2 of 2

Thread: QApplication::notify()

  1. #1
    Join Date
    May 2009
    Location
    Memphis, TN
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QApplication::notify()

    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.

  2. #2
    Join Date
    May 2009
    Location
    Memphis, TN
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Post Re: QApplication::notify()

    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!

    Qt Code:
    1. try {
    2. mp_TwainPRO->OpenSession();
    3. }
    4. catch (_com_error &e) {
    5. handleError(e);
    6. return;
    7. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Reimplementing QApplication::notify( )
    By Rayven in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2008, 17:22
  2. Reimplementing QApplication::notify()
    By Doug Broadwell in forum Qt Programming
    Replies: 5
    Last Post: 21st June 2007, 21:41
  3. Reimplementing QApplication::notify()
    By Doug Broadwell in forum Newbie
    Replies: 3
    Last Post: 13th June 2007, 07:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.