Hier habe ich noch den Code vom Form:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
| public partial class Form2 : Form { public List<String> propNameToBib = new List<String>();
public Form2(List<String> NameAusBib) { InitializeComponent(); box(NameAusBib); } public void box(List<String> NameAusBib) { int i = NameAusBib.Count; this.checkedListBox1.Items.AddRange(new object[] { NameAusBib[0] }); for (int alle = 1; i > alle; alle++) { this.checkedListBox1.Items.Add(NameAusBib[alle]); } } private void form2_FormClosed(object sender, EventArgs e) { foreach (object itemChecked in checkedListBox1.CheckedItems) { propNameToBib.Add(itemChecked.ToString()); } this.Close(); } } |
Noch einer kurze info das ganze ist einer AutoCAD Architecture 2009 application, die application wird mit einer .dll gestartet.
Ich bin mir eigentlich sicher das der Fehler mit der Form zusammen hängt, denn vorher hatte ich keine Form drinnen und da hat es fehler frei funktioniert.
Ich weis in einer .dll ein Form starten ist nicht toll aber die application kann nur als .dll ausgeführt werden
Ist das der Stacktrace?
************** Ausnahmetext **************
System.ArgumentOutOfRangeException: Der Index lag außerhalb des Bereichs. Er muss nicht negativ und kleiner als die Auflistung sein.
Parametername: index
bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
bei System.ThrowHelper.ThrowArgumentOutOfRangeException()
bei ACAversuch2.Class1.acapro() in C:\Dokumente und Einstellungen\admin\Eigene Dateien\Visual Studio 2008\Projects\ACAversuch2\ACAversuch2\Class1.cs:Zeile 37.
bei Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
bei Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
bei Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
bei Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
*******************************************
lg
blacknitram