Ranorex

Type casting

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
dbi1463



Joined: 28 Nov 2007
Posts: 1

PostPosted: Wed Nov 28, 2007 11:58 am    Post subject: Type casting
I'm a TA of a Windows Programming course in a Taiwan univeristy. We use Ranorex (free edition) for GUI automation and testing. I has a class in a C# program: KeynoterView inherited System.Windows.Forms.Form. I used RanorexNet to start the application, and actually it works fine.
However, there still exists a problem that I want to cast Ranorex.Form to KeynoterView because I want to call some methods in KeynoterView for testing. How do I do?
Back to top
View user's profile Send private message
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 435

PostPosted: Wed Nov 28, 2007 12:41 pm    Post subject:
I'm sorry, but C# casting doesn't work that way. Since Ranorex.Form does not inherit from KeynoterView, you cannot cast an instance of Ranorex.Form to your custom form.

Ranorex.Control (which is the base class for Ranorex.Form) is just a wrapper that makes properties and methods of a Control from a separate process available to the process running Ranorex. I.e., it's not an instance of the actual class running in your KeynoterView application.

Currently, Ranorex supports accessing the most common properties of Controls from another process. Ranorex 1.4 (Professional version) will include the possibility to access all public properties and methods of controls, even those of custom controls.

Regards,
Alex
Ranorex Support 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 -> RanorexNet 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