Ranorex

ToolStrip functions have bugs? Ranorex-0.9.4

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



Joined: 17 Oct 2006
Posts: 2

PostPosted: Wed Oct 18, 2006 9:38 am    Post subject: ToolStrip functions have bugs? Ranorex-0.9.4
I use ToolStrip functions to operate the toolbar (toolStrip) , and find that
it thows exception because of memory access error(ox0000) , why?
How to test toolBar? Thank you!

my test code as follows:


HWND hWndToolbar = RxFormFindChildClassName(form, "ToolbarWindow32");

if ( hWndToolbar == 0)
{
TRACE(" ERROR: tool bar not found\n");
}

RxToolStripSelectItemText(hWndToolbar, "Edit"); //throws exception during execution. While debuging, it work well. memory access error. why?

RxToolStripSelectPosition(hWndToolbar, 1); //always throws exception. memory access error
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Wed Oct 18, 2006 10:46 pm    Post subject:
The control ToolStrip is new in Visual Studio 2005 and it does not exists in earlier windows versions. If the class name of your control is "ToolbarWindow32", then you have a Toolbar and not a ToolStrip, a ToolStrip has always a Control name and a Class name (WindowsForms10.Windows.8.app...).

The RxToolStrip functions in V0.9.4 work only with ToolStrips, you can automate the elements of a Toolbar in 0.9.4 as follows:

Code: click into code to enlarge
// Click the Toolbar button with the name 'Open'
ElementStruct element;
if ( RxControlGetElement(hWndToolbar, &element) == TRUE)
{
    // Find and click the toolbar item with the name 'Open'
    ElementStruct toolBarItem;
    if ( RxElementFindChild(&element, ROLE_SYSTEM_PUSHBUTTON, "Open", NULL, &toolBarItem) == TRUE )
        RxMouseClickElement(&toolBarItem);
}

You will be able to use the RxToolStrip functions also for a Toolbar in V0.9.5, i uploaded the first Beta to try:

http://www.ranorex.com/download/RanorexCore-0.9.5-Beta1.zip

You can use the functions as follows:

Code: click into code to enlarge

RxToolStripSelectItemText(hWndToolbar, "Edit", NULL);   // please use a NULL as last argument
RxToolStripSelectPosition(hWndToolbar, 1);
...


Jenö Herget
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 -> RanorexCore 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