L
Lou
I get an error when i try to enumerate through the list
SortedList Projects = new SortedList();
//Create a Project object
cProject Project = new cProject(mxDoc);
Project.Name = strFileName;
//Add the project object to a list of projects
Projects.Add(strFileName, Project);
//Enumerate through the list. This is where I get the error
foreach (cProject myProject in Projects)
{
this.treeView1.Nodes[0].Nodes.Add(myProject.Name);
}
System.InvalidCastException was unhandled
Message="Unable to cast object of type
'System.Collections.DictionaryEntry' to type
'InflexionTestHarness.cProject'."
SortedList Projects = new SortedList();
//Create a Project object
cProject Project = new cProject(mxDoc);
Project.Name = strFileName;
//Add the project object to a list of projects
Projects.Add(strFileName, Project);
//Enumerate through the list. This is where I get the error
foreach (cProject myProject in Projects)
{
this.treeView1.Nodes[0].Nodes.Add(myProject.Name);
}
System.InvalidCastException was unhandled
Message="Unable to cast object of type
'System.Collections.DictionaryEntry' to type
'InflexionTestHarness.cProject'."