hi all genious out there ......,
I am facing a problem in using multi-threading .......

i have active-x exe which is apartment model of threading with thread per object option.Each class in it is multi-use...

From the exe ...
I create a object of a class say objclass1 and it starts executing asyncronously in its own thread. This class also starts another class i.e classMessenger which also runs in its own thread.
In my exe i maintain the reference to objclass1 and also to classMessenger.My exe and class1 interact with each other through the classMessenger to know the status etc(thus avoiding blocking of each other when each is busy with something else)

similarly i create another object of another class say objclass2 and get it run asyncronously (with classmessenger and all)

now both the class class1 and class2 run simultaneously and asyncronously ..right ......

(now if i want to inform or get its status or ask it to cancel i do it through the classMessenger ...well this is just extra information)

now as it is running ...
i set the reference to objclass1 as nothing and keep the reference to objclass2 as it is...(still both threads continue to run and that is fine )
but at the end when both objclass1 and objclass2 have finished processing it gives a error saying the active-exe (in fact the project name) has performed an illegal operation ....

if u could help me ............thanks
i hope i have clarified the things ........

c u