Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
Questioncross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 1:19
But_Im_a_Lady17-Apr-09 1:19 
AnswerRe: cross thread operation not valid, when closing a windows form Pin
Henry Minute17-Apr-09 1:55
Henry Minute17-Apr-09 1:55 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 2:05
But_Im_a_Lady17-Apr-09 2:05 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
Henry Minute17-Apr-09 2:12
Henry Minute17-Apr-09 2:12 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 2:14
But_Im_a_Lady17-Apr-09 2:14 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 2:25
But_Im_a_Lady17-Apr-09 2:25 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
Henry Minute17-Apr-09 2:39
Henry Minute17-Apr-09 2:39 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 2:49
But_Im_a_Lady17-Apr-09 2:49 
I am using 'System.Threading', the code is below:-


private void FaxEngineersRequest()
        {
            try
            {
                //SendZetaFax sendZetaFax = new SendZetaFax ();
                //sendZetaFax.FaxBody = _processingModule.CreateEngineerCallSheet ( _callNumber ).ToString ();
                //sendZetaFax.FaxNumber = usrAddressDetailsEngineer.Fax;
                //sendZetaFax.RecipientName = usrAddressDetailsEngineer.Contact;
                //sendZetaFax.From = _sysCNDR.Name;

                ////Since the processing for Zeta fax can be v.slow - do processing on a separate thread.
                //Thread thread = new Thread ( new ThreadStart ( sendZetaFax.SendFaxMessage ) );
                //thread.Start ();
            }
            catch (Exception ex)
            {
                _commonValidation.DisplayErrorGracefully ( ex );
            }
        }


As you can see I have commented this part of the code out - so it will never run, but I still get the cross thread operation not valid error.


<blockquote class="FQ"><div class="FQA">Henry Minute wrote:</div>Whichever type, one way might be to handle the FormClosing event of your main form and close/de-activate the thread there. </blockquote>
Not quite sure how / if / why I need to do this Confused | :confused:

Janet

Lady Programmers are a rare breed!

GeneralRe: cross thread operation not valid, when closing a windows form Pin
Henry Minute17-Apr-09 2:59
Henry Minute17-Apr-09 2:59 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady20-Apr-09 1:16
But_Im_a_Lady20-Apr-09 1:16 
AnswerRe: cross thread operation not valid, when closing a windows form Pin
12Code17-Apr-09 2:06
12Code17-Apr-09 2:06 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 2:15
But_Im_a_Lady17-Apr-09 2:15 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 2:22
But_Im_a_Lady17-Apr-09 2:22 
AnswerRe: cross thread operation not valid, when closing a windows form Pin
0x3c017-Apr-09 2:46
0x3c017-Apr-09 2:46 
GeneralRe: cross thread operation not valid, when closing a windows form Pin
But_Im_a_Lady17-Apr-09 2:54
But_Im_a_Lady17-Apr-09 2:54 
AnswerRe: cross thread operation not valid, when closing a windows form Pin
Luc Pattyn17-Apr-09 4:01
sitebuilderLuc Pattyn17-Apr-09 4:01 
QuestionNeed Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
A.Q.Ghouri17-Apr-09 1:15
A.Q.Ghouri17-Apr-09 1:15 
AnswerRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
Rajesh Anuhya17-Apr-09 1:22
professionalRajesh Anuhya17-Apr-09 1:22 
GeneralRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
A.Q.Ghouri20-Apr-09 18:06
A.Q.Ghouri20-Apr-09 18:06 
AnswerRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
Giorgi Dalakishvili17-Apr-09 2:07
mentorGiorgi Dalakishvili17-Apr-09 2:07 
GeneralRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
A.Q.Ghouri20-Apr-09 18:29
A.Q.Ghouri20-Apr-09 18:29 
QuestionWhy the line disappear? Pin
lune1217-Apr-09 1:15
lune1217-Apr-09 1:15 
AnswerRe: Why the line disappear? Pin
Luc Pattyn17-Apr-09 1:18
sitebuilderLuc Pattyn17-Apr-09 1:18 
GeneralRe: Why the line disappear? Pin
Henry Minute17-Apr-09 1:24
Henry Minute17-Apr-09 1:24 
GeneralU R D) Pin
Luc Pattyn17-Apr-09 1:38
sitebuilderLuc Pattyn17-Apr-09 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.