J
Jerry
I have an object which uses a class from a dll.
the dll is XTAPI.dll
I have a class
public class a
{
public XTAPI.b xb = null;
public XTAPI.c xc = null;
public string temp = "";
public a()
{
xb = new XTAPI.b();
xc = new XTAPI.c();
temp = "new string";
}
...
}
and another class
public class d
{
...
}
I have a form that initiliaze class a in the form_load function.
when my event handler is called to process an event from class d I
need to use class a to perform certain functions. The problem is that
my class a seems to have lost access to xb and xc (I think the garbage
collector took it)
I didnt want to recreate class a everything in the event handler
because it has certain overhead which I want to reduce to only
performing once hence why I tried to initiliaze it in the form_load
function of the form.
Can anyone tell me why or how to fix my code so that I am able to see
my objects in class a?.
p.s as an added note I can see the string in class a but I get an
error: cannot obtain value when I am in the event handler for class d
when I try to look into the object xb and xc of class a.
thanks
the dll is XTAPI.dll
I have a class
public class a
{
public XTAPI.b xb = null;
public XTAPI.c xc = null;
public string temp = "";
public a()
{
xb = new XTAPI.b();
xc = new XTAPI.c();
temp = "new string";
}
...
}
and another class
public class d
{
...
}
I have a form that initiliaze class a in the form_load function.
when my event handler is called to process an event from class d I
need to use class a to perform certain functions. The problem is that
my class a seems to have lost access to xb and xc (I think the garbage
collector took it)
I didnt want to recreate class a everything in the event handler
because it has certain overhead which I want to reduce to only
performing once hence why I tried to initiliaze it in the form_load
function of the form.
Can anyone tell me why or how to fix my code so that I am able to see
my objects in class a?.
p.s as an added note I can see the string in class a but I get an
error: cannot obtain value when I am in the event handler for class d
when I try to look into the object xb and xc of class a.
thanks