V
VonGuller
Hello,
I have a code like this(as an example) :
public class class1:UserControl
{
private MyOwnCollectionBasedClass pList1;
public MyOwnCollectionBasedClass List1
{
get{ return pList1;}
set{pList1 = value;}
}
public class1()
{
pList1 = new MyOwnCollectionBasedClass()
}
private void class1_load(object sender, EventArgs e)
{
LoadMethod();
}
private void LoadMethod()
{
int count = List1.Count;
}
}
This is a user control on a form docked as fill.
In Most of the computers this works ok, but on some computers this
crashes on LoadMethod(). For somereason the List1 is null and there
comes ObjectNullReferenceException:Object reference not set to an
instance of an object.
Why is List1 null? It is initialized in the constructor...The
MyOwnCollectionBasedClass constructor doesn't have any code...so it
should happen fast.
Regards, Jyri
I have a code like this(as an example) :
public class class1:UserControl
{
private MyOwnCollectionBasedClass pList1;
public MyOwnCollectionBasedClass List1
{
get{ return pList1;}
set{pList1 = value;}
}
public class1()
{
pList1 = new MyOwnCollectionBasedClass()
}
private void class1_load(object sender, EventArgs e)
{
LoadMethod();
}
private void LoadMethod()
{
int count = List1.Count;
}
}
This is a user control on a form docked as fill.
In Most of the computers this works ok, but on some computers this
crashes on LoadMethod(). For somereason the List1 is null and there
comes ObjectNullReferenceException:Object reference not set to an
instance of an object.
Why is List1 null? It is initialized in the constructor...The
MyOwnCollectionBasedClass constructor doesn't have any code...so it
should happen fast.
Regards, Jyri