I am stumped.
I started implementing a version of my Forms app that takes command line arguments, but started getting errors. I reverted my changes - but this exception remains:
The project compiles fine, but when I start the app (debugging), just after my main Form shows, the app halts throwing the following exception:
System.ArgumentException occurred HResult=0x80070057 Message=Value does not fall within the expected range. Source= StackTrace: at Accessibility.IAccessible.get_accChild(Object varChild) at System.Windows.Forms.AccessibleObject.Accessibility.IAccessible.get_accChild(Object childID) at System.Windows.Forms.InternalAccessibleObject.System.Windows.Forms.UnsafeNativeMethods.IAccessibleInternal.get_accChild(Object childID)
Edit/FYI: I have "Enable just my code" turned off - this doesn't happen when it is turned on.
I still somehow haven't found the offending code. Stepping through everything in Form1()
returns me to the call in Program.cs, where the Exception suddenly happens.
I'll manage getting my project to run in the end, one way or another - I'd still really like to know where and what the problem is (for me and posterity) - any hints and help is still very much appreciated
I have since whittled down the app to the bare bones, only showing the main form, without doing anything. I still get this weird message.
program.cs:
using System;
using System.Windows.Forms;
namespace Move_Stuff
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Form1.cs:
using System;
using System.Windows.Forms;
namespace Move_Stuff
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
MessageBox.Show("Fine so far");
}
}
}
So those are probably not the culprit.
Here is my complete project folder: https://mega.nz/#!9mQVWLqI!MN1tYS4cQk5-ZolosDvvIme2_Lk9rjSogPhHzrJvPt0
Where did things go wrong?
private System.ComponentModel.IContainer components = null;
, an override for the.Dispose()
method, and declarations for all controls (likeprivate System.Windows.Forms.Button bClear;
). What should I be looking out for? – Ben PhilippinitializeComponent()
. The messageBox in.Load()
is shown fine before it happens :/ – Ben Philipp