Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I created some kind of surfing control application. The application open a form, get from the user cardinals, and then it close up and run background thread that sends information about the surfing activity to logger.

Sometimes there is a need, of course, to open again the form to change settings� but since the back ground thread is a different thread, there is no way to open the "same" form again, nor close the net listener, each try to do so and with exception that generally says that you can't control the main process from another thread. I can't create new instance of the main form, since the network card is "busy" with the first process. I found that code that open the main form again-

                            CaptureForm cf = new CaptureForm();
                           showHide = true;
                           cf.Show();
                           Application.Run();

 

It does open the same main form, but the background thread are still collision. And any try to make changes to the running threads (like stop the capture of network movements) end with the same exceptions� I have to open the form from the background thread, since it's the only communication I have with the application after the form close. How can I catch the mainform? Or change anything in the background running threads?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...