Error after a few hours of DoEvents

  • Thread starter Thread starter Jeff Cooper
  • Start date Start date
J

Jeff Cooper

Hi,

I have an app that often has no windows and uses a NotifyIcon. My Sub Main
has a loop:
Do Until gExit

Application.DoEvents()

Loop

When running the app in development, it works fine. But when running the
exe, DoEvents() raises the following error after several hours:

An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: Item has already been added. Key in dictionary:
"-1" Key being added: "-1"

There's nothing in my app that should happen without human interaction
(clicking, double-clicking the notifyicon, etc). So I'm not sure what's
happening here. The program is basically just sitting there, waiting for
something to happen. I left it running last night and found the error this
morning, so it's not like I'm accidentaly clicking a window or icon and
raising something. I can't find anything in various groups relating to
this. Anyone have any thoughts?

Thanks,

Jeff
 
I'm having the same problem - my loop's almost identical - help us please!

James

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Back
Top