UFT 11.53 is not recognizing flex dialog.
I have a scenario where I have set a value in Flex edit and the hierarichy is Browser().Page().FlexWindow().FlexDialog().FlexEdit().Set "Value" and i have a function regFXsetValue() to do this.
When I am executing this function individually UFT 11.53 is setting value, but when I run that particular function along with other functions in the script UFT 11.53 is not identifying the flex dialog. It is stopping our batch execution.
It means that some other function which is getting called before this function is affecting the object recognition of the Flex edit object. Best is to put UFT in debug mode. Go through each line and just before this function to set value in flex edit is called, hold the execution and spy this object. Check identification properties and see if they are same as the ones you have used in your OR or in descriptive programming. I am sure you will find the bug.
Related
How can I a write window to a specific node in CANoe configuration? I can see a write window for node SSC EV but I wanted to add another one more for a node.
first of all take a look in CANoe manual
CANoe» Analysis Windows » Write Window
here you will find important note about limitations for lines in Write-Window.
Thereafter you can find short explanation about standard pages in Write-Window here:
Write Window » Views
There is also a link to CAPL function writeCreate() which can be used to create new page. The return value of this function shall be used as parameter for function writeConfigure() to write onto created page. See also example for this functions in help.
I'm having a bit of trouble with Unity 4.6's new UI tools.
On the canvas I have a list of toggles that are created dynamically at runtime (I'm following the instructions of this tutorial https://www.youtube.com/watch?v=TRLsmuYMs8Q more or less). I'm trying to add a trigger to every one of the toggles, that would call a function ListManager.LoadModel(int), when the toggle is clicked. Every toggle's event would have a different int assigned to it (the first one would call LoadModel(0), the second LoadModel(1) and so on).
It's easy to create a list of toggles manually and hardcode the calls to every one of them in Inspector but I cannot figure out how add the triggers to the toggles as I'm creating them dynamically with the script. Any suggestions?
I have a hierarchical flexgrid control with the ToolTipText property set, and when I run from source the tooltip displays as it should. But when I compile it and run that way, the tooltip doesn't display.
I've tried to remove anything listening to MouseMove in the hopes that that would fix it, and when I add some code to put the tooltip text into a message box, it appears to be set correctly. Can anyone think of why this would be happening?
Update: It appears that the problem arises when I host the grid inside another user control. E.g.: make container.ctl, which is just a blank control but with ControlContainer = True. Then make gridholder.ctl, which is a mshfg inside of a container.ctl. Lastly, embed gridholder.ctl into some form. Tooltips on the flexgrid don't appear to show up.
I'm interested to see how reproducible this is...
I haven't found a workaround for this issue yet, but I have a better idea of why it's happening after some testing and stepping through some of the VB6 runtime code in WinDBG.
The first interesting thing is that VB6 doesn't use the standard tooltip display mechanisms provided by Windows. For example, it doesn't use WM_NOTIFY messages to show/hide tooltips, or any of the other "standard" tooltip support described in the documentation explaining how tooltips work in Windows.
Instead, the VB6 runtime has its own way of managing and displaying tooltips. In principle, it's similar to in some ways to the standard Windows way of dealing with tooltips, but it's also different in a quite a few areas.
A breakdown of how VB6 does tooltips:
When a VB6 program starts, the runtime uses SetWindowsHookEx to install a mouse hook for the program's main thread.
The mouse hook intercepts all mouse messages sent to the program, in particular all WM_MOUSEMOUSE messages
Whenever the mouse hook runs, it calls an internal method in the VB6 runtime to get the object pointer (HCTL) of the control that the mouse is currently over top of. Note that this is an actual COM interface pointer, not a window handle.
It translates the HCTL to the corresponding window handle (HWND).
It checks to see if the mouse position is within that window's rectangle.
If so, it retrieves the ToolTipText property for the control. If this is not empty, it creates a tooltip window and displays the tooltip after a 700ms delay.
The problem with the MSHFlexGrid (and I imagine other controls that are not standard VB6 controls) is that this code doesn't retrieve the correct HCTL when you hover over the control and it's inside a custom container.
In that case, the code retrieves the HCTL of the custom container, not the HCTL of the MSHFlexGrid itself. Therefore, it retrieves the container's ToolTipText property (which is empty) and not the grid's ToolTipText, and therefore won't display a tooltip.
I'm not sure exactly why it does this, because as noted in the comments on your question, all of this works correctly if you use a PictureBox as your container.
I suspect the PictureBox has code to handle this correctly that is not included when you create your own container.
I'll update this answer with an actual workaround if I can find one. The only thing I can think right now is to somehow "sync" your container's ToolTipText property with the grid's ToolTipText property, so that when VB6 requests the container's ToolTipText, it will return the value of the grid's ToolTextTip property instead.
This is easier said than done, however, because ToolTipText is an extender property, and extender properties take precedence over properties that you write yourself that have the same name.
After a bit of research, I found what I think is the underlying problem. Your user control is not implementing any method for the controls to interact with. User Controls that are Container Controls need to implement the Extender functionality. These two links are the best I've found on the subject so far.
http://www.justvb.net/obook/ch7.htm#UsingtheExtenderObject
http://msdn.microsoft.com/en-us/library/aa733622(v=vs.60).aspx
I'm writing a GUI in Scilab and assigning callbacks to pushbutton controls. When a button is pressed, another control is affected, e.g. text inside a textbox changes. This whole routine itself (creation and initialization of the GUI) lives inside a function, that is I have to call my create_my_gui() to run it.
My problem lies in variable scope and callback usage. Several of my buttons affect several other controls in exactly the same way, so I would like to use the same callback function and pass a handle to the control I'm trying to affect into the callback.
For example when I press the N-th button, I'd like to pass the handle N-th control into the callback:
function buttonPressCallback ( controlHandle )
controlHandle.string = 'Button pressed!';
endfunction
The problem is that callbacks are defined as strings:
myButton3.callback = 'buttonPressCallback ( myTextBox3 )'
And after I've run my create_my_gui() function, all variables go out of scope and are destroyed, including handles to all controls. When I press the button, Scilab tries to run whatever string was specified as the callback and complains about the variable, myTextBox3 for example, not existing.
Is there a way I can refer to uicontrols in Scilab after the function that created them exited? I understand that Scilab has very peculiar ways of addressing things and perhaps I'm just not thinking in correct Scilab programming patters just yet. Is there the "right way" of doing this?
Found a decent solution. Each uicontrol can be tagged by setting myUicontrol.tag = 'my_tag';. This uicontrol can then be found globally using my_handle = findobj('tag','my_tag');.
You can acccess the calling uicontrol object via gcbo, like:
get(gcbo,"value");
I am using Windows 7 and my project is in VB 6.0. I am getting errors while I am executing my program. It shows the error:
User-defined type not defined.
Here is my code:
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "trace": Call mntrace_Click
Case "snrplot": Call mnSnrplot_Click
Case "skyplot": Call mnskyplot_Click
Case "nmea": Call mnNmea_Click
Case "navigation": Call mnNavigation_Click
Case "survey": Call mnSurvey_Click
Case "pause/start": Call mnpause_Click
Case "save": Call mnsave_Click
Case "print": Call mnprint_Click
Case "offline": Call mnoffline_Click
End Select
End Sub
How can I solve this error?
The compiler is automatically highlighting the first line of the function declaration for you when the error appears. That means the error occurs somewhere within that line. Sometimes that's not as helpful as you'd like, but in this case, it manages to tell you quite a lot.
Specifically, the only "user-defined type" (really, the only "type" at all) that appears in the function declaration is MSComctlLib.Button. What the compiler error message is telling you here is that it doesn't know what a MSComctlLib.Button is. It therefore assumes it's a "user-defined" type because it often doesn't know what the user is talking about. :-)
Either way, the fix is simple: you need to tell the compiler what an MSComctlLib.Button is. In this case, it guessed wrong in assuming that it is a user-defined type. It's actually a button control provided in the Microsoft Windows Common Controls Library. To tell VB 6 about this control, you need to add the corresponding component to your project. Follow these steps:
From the "Project" menu, select "Components".
In the dialog box that appears, scroll about 2/3 of the way down the list to the M's. Place a check by both the "Microsoft Windows Common Controls 6.0" and "Microsoft Common Controls-2 6.0" items. (Don't worry if yours have a different service pack designation.)
Click the OK button. If you're quick, you'll see some additional controls being added to your toolbox. These are the controls provided by the component libraries that you just added. Among those controls is one called Button.
Finally, try to compile and run your project again—everything should be fine this time, because now the compiler knows what the MSComctlLib.Button type is. In case you still don't, it's a button that appears on your toolbar. The toolbar control is provided by the Common Controls library, and it includes a type that defines an individual button appearing on that toolbar.
Sounds like you are missing a reference to an object library.
(Have you executed it without errors elsewhere?)
I think you just copied and pasted that code from elsewhere. Normally, if you wanted to reference MSComctlLib, you will normally do first the steps stated by Cody Gray here before you can access the Type Library.