Ranorex

I am getting fatal error in Application.GetForms()

 
Post new topic   Reply to topic    Ranorex Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
arishahsan



Joined: 18 Jan 2007
Posts: 26

PostPosted: Mon Apr 16, 2007 6:54 am    Post subject: I am getting fatal error in Application.GetForms()
Following is the code which gives error.

Application.GetForms();
foreach (Form TempForms in Application.Forms)
{
Form TempForm = Application.FindFormTitle(TempForms.Text);
Trace.Assert(TempForm != null);
//Error arises in the following line
if (TempForm.Element.Class == WindowsForms10.Window.8.app.0.33c0d9d)
{
//Some Statements
}

Error message is:

Fatal ExecutionEngine Error was executed
The runtime has encountered a fatal error. The address of the error was at 0x79e8a634, on thread 0x3fc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Mon Apr 16, 2007 9:14 pm    Post subject:
Hi,

I can't reproduce the bug you described. Please try the following examples.

You can read all forms by classname as below:
Code: click into code to enlarge
Application.GetForms();
foreach (Form TempForm in Application.Forms)
{
    if (TempForm.Element.Class == "WindowsForms10.Window.8.app.0.378734a")
    {
        Console.WriteLine("form found: " + TempForm.Text);
    }
}


If you want to find the first form by it's classname use the FindFormClassName() method:
Code: click into code to enlarge
Form TempForm = Application.FindFormClassName("WindowsForms10.Window.8.app.0.378734a")  ;
if (TempForm != null)
{
    Console.WriteLine("form found: " + TempForm.Text);
}


Gabor
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> Bug Reports All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum