Hello,
The error you are seeing is almost always going to display when there has been a memory-allocation mismanagement of some kind. How to track it down? This is rather challenging.
In your case the problem is not evident from the code you provided. The problem is your line of code:
Application.Run(frm)
At that point forward, we have lost visibility of everything your program is doing or is trying to do.
My first suggestion is to keep your code exactly as-is and in your frm's Main sub, just comment-out EVERYTHING then add this line:
System.Windows.Forms.Appli
cation.Exi
t()
Then see if you still get the error. If you don't, the problem is likely in the code the you had removed from
frm Main or something that ran after the frm was loaded and running. Otherwise, you might benefit from reading more here:
http://geekswithblogs.net/mtreadwell/archive/2004/06/06/6123.aspxand
http://vbcity.com/forums/p/96612/406742.aspxRegards,
Jon