Exception when hiding the ProgressForm : Bug Reports

Exception when hiding the ProgressForm

Bug reports and feature requests.

Exception when hiding the ProgressForm

Postby Ciege » Fri Jun 17, 2011 6:33 pm

I am using the ProgressForm to display updates to the user during a long process...

Code: Select all
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.None, "tempTestReport.rxlog", false);
Ranorex.Core.Reporting.TestReport.EnableTracingScreenshots = false;
Ranorex.Core.Reporting.TestReport.ReportWriteInterval = 0;
Ranorex.Controls.ProgressForm.Show();


At the end of the process I am hiding the ProgressForm but getting an exception.
Code: Select all
Ranorex.Controls.ProgressForm.Hide();


Exception:
Code: Select all
Fatal error: System.InvalidOperationException: Cross-thread operation not valid: Control 'ProgressForm' accessed from a thread other than the thread it was created on.
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.Hide()
at Ranorex.Controls.ProgressForm.Hide()
at CBS_Import_Test.Program.VerifyTags(Form HDClientForm, String[] Tags) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\CBS Import Test\CBS Import Test\Program.cs:line 1127
at CBS_Import_Test.Program.CBSImportTest(String strDateTimeStamp, String strDateTimeStampClean) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\CBS Import Test\CBS Import Test\Program.cs:line 302
at CBS_Import_Test.Program.Main(String[] args) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\CBS Import Test\CBS Import Test\Program.cs:line 101
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Exception when hiding the ProgressForm

Postby Support Team » Mon Jun 20, 2011 1:00 pm

Hi Ciege,

Thank you for posting us this bug, currently as workaround you can the solution suggested by sdaly
can-i-control-ranorex-controls-progressform-t2318.html

With Ranorex 3.0.3 we will handle this in our code and you should remove the currently workaround.

Regards,
Peter
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4842
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Exception when hiding the ProgressForm

Postby Ciege » Mon Jun 20, 2011 4:58 pm

Yup, I put in the crossthreadcheck = false and the issue is worked around successfully.
Thanks...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests