I am having an small application which is running in a thread and it is waiting for an event initially. As soon as if i clicked the START button, event will be enabled. From then onwards my entire application is running in WHILE (TRUE) loop. That means that i want to run my application continuously. As soon as if i clicked the STOP button, i am reseting the event and exiting the application. But here i am facing one problem. Once if i clicked the STOP button, my application is hanging. Can any one give me some ideas, to overcome this problem.
Additional Information: -
1) I have created the class library for my application. ( This creates DLL for my application )
2) In order to test my application, i have created the small form based application which will call my actual application
3) I have included that DLL as a reference in the reference list, in the Form based application
4) I have used the "ManualResetEvent" Class to handle the events.
Please give me the solution. It's urgent. Reply back to me if anyone needs more inputs.