Missing objects (c#)

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
 
V

Victor Bazarov

Jerry said:
I have an object which uses a class from a dll.

the dll is XTAPI.dll

I have a class

public class a
{
[...]

This is a C++ newsgroup. You probably need

microsoft.public.dotnet.languages.csharp

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,503
Latest member
supremedee

Latest Threads

Top