DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Help with an exception while exiting an app using the systray Icon

  1. #1
    Guest

    Help with an exception while exiting an app using the systray Icon

    Hello,

    I have added some freeware code to my application to place an icon in the
    System Tray, When you right click I popup a menu with an option to close
    the appliction. This fires the cmdExit_click event. If I use this
    popupmenu choice to do this I get this message:

    Exception floating point inexact result. in kernel32.dll


    I don't get this from within my application when I use the cmdExit button?


    Has anyone seen this behavior?


    Greg










  2. #2
    Karl E. Peterson Guest

    Re: Help with an exception while exiting an app using the systray Icon

    Hi Greg --

    > I have added some freeware code to my application to place an icon in the
    > System Tray, When you right click I popup a menu with an option to close
    > the appliction. This fires the cmdExit_click event. If I use this
    > popupmenu choice to do this I get this message:
    >
    > Exception floating point inexact result. in kernel32.dll
    >
    > I don't get this from within my application when I use the cmdExit button?


    Probably because you're still in the middle of a message call. Just do an Unload Me
    in both places, then handle all your clean-up in Form_Unload. In particular, make
    sure you're calling ShellNotifyIcon to delete the tray icon. There's an example on
    my site, btw.

    Later... Karl
    --
    http://www.mvps.org/vb




  3. #3
    Karl E. Peterson Guest

    Re: Help with an exception while exiting an app using the systray Icon

    Hi Greg --

    > I have added some freeware code to my application to place an icon in the
    > System Tray, When you right click I popup a menu with an option to close
    > the appliction. This fires the cmdExit_click event. If I use this
    > popupmenu choice to do this I get this message:
    >
    > Exception floating point inexact result. in kernel32.dll
    >
    > I don't get this from within my application when I use the cmdExit button?


    Probably because you're still in the middle of a message call. Just do an Unload Me
    in both places, then handle all your clean-up in Form_Unload. In particular, make
    sure you're calling ShellNotifyIcon to delete the tray icon. There's an example on
    my site, btw.

    Later... Karl
    --
    http://www.mvps.org/vb




  4. #4
    Guest

    Re: Help with an exception while exiting an app using the systray Icon

    Hi Karl,

    I am sure you are right. I now have a concrete example why one doesn't use
    End when an Unload will do.

    Thanks,

    Greg


    "Karl E. Peterson" <karl@mvps.org> wrote in message
    news:3925b32a$1@news.devx.com...

    > Hi Greg --
    > Probably because you're still in the middle of a message call. Just do an

    Unload Me
    > in both places, then handle all your clean-up in Form_Unload. In

    particular, make
    > sure you're calling ShellNotifyIcon to delete the tray icon. There's an

    example on
    > my site, btw.
    >
    > Later... Karl
    > --
    > http://www.mvps.org/vb
    >
    >
    >




  5. #5
    Guest

    Re: Help with an exception while exiting an app using the systray Icon

    Hi Karl,

    I am sure you are right. I now have a concrete example why one doesn't use
    End when an Unload will do.

    Thanks,

    Greg


    "Karl E. Peterson" <karl@mvps.org> wrote in message
    news:3925b32a$1@news.devx.com...

    > Hi Greg --
    > Probably because you're still in the middle of a message call. Just do an

    Unload Me
    > in both places, then handle all your clean-up in Form_Unload. In

    particular, make
    > sure you're calling ShellNotifyIcon to delete the tray icon. There's an

    example on
    > my site, btw.
    >
    > Later... Karl
    > --
    > http://www.mvps.org/vb
    >
    >
    >




  6. #6
    Karl E. Peterson Guest

    Re: Help with an exception while exiting an app using the systray Icon

    Hi Greg --

    > I am sure you are right. I now have a concrete example why one doesn't use
    > End when an Unload will do.


    Is that right??? I didn't even pause to consider you might be calling End. Yeah,
    that wouldn't be too cool in response to sinking a window message. <g>

    Definitely a command that just ought to be NOP'd! :-)

    Later... Karl
    --
    http://www.mvps.org/vb



    > "Karl E. Peterson" <karl@mvps.org> wrote in message
    > news:3925b32a$1@news.devx.com...
    >
    > > Hi Greg --
    > > Probably because you're still in the middle of a message call. Just do an

    > Unload Me
    > > in both places, then handle all your clean-up in Form_Unload. In

    > particular, make
    > > sure you're calling ShellNotifyIcon to delete the tray icon. There's an

    > example on
    > > my site, btw.
    > >
    > > Later... Karl
    > > --
    > > http://www.mvps.org/vb
    > >
    > >
    > >

    >
    >




  7. #7
    Karl E. Peterson Guest

    Re: Help with an exception while exiting an app using the systray Icon

    Hi Greg --

    > I am sure you are right. I now have a concrete example why one doesn't use
    > End when an Unload will do.


    Is that right??? I didn't even pause to consider you might be calling End. Yeah,
    that wouldn't be too cool in response to sinking a window message. <g>

    Definitely a command that just ought to be NOP'd! :-)

    Later... Karl
    --
    http://www.mvps.org/vb



    > "Karl E. Peterson" <karl@mvps.org> wrote in message
    > news:3925b32a$1@news.devx.com...
    >
    > > Hi Greg --
    > > Probably because you're still in the middle of a message call. Just do an

    > Unload Me
    > > in both places, then handle all your clean-up in Form_Unload. In

    > particular, make
    > > sure you're calling ShellNotifyIcon to delete the tray icon. There's an

    > example on
    > > my site, btw.
    > >
    > > Later... Karl
    > > --
    > > http://www.mvps.org/vb
    > >
    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center