kalldrexx
15 years agoContributor
TC7's WaitAliasChild is not using the supplied WaitTime parameter
It seems like the WaitAliasChild() function does not work correctly as described in the TC7 docs. For example, I want to check if my WinRDE.fmEditCheck aliased window exists. If I just try to access WinRDE.fmEditCheck when it doesn't exist, TC sits there for 10-20 seconds trying to find it or access it, so I decided to try and use WaitAliasChild to fix that (if it doesn't exist, it's not going to exist). So in my code I have the following code (note: all code is done in C# using the C# TC libraries):
With this code, if fmEditCheck exists, everything is fine. If the fmEditCheck form does not exist, the code is *supposed* to wait for 5 milliseconds and then move on to the IF statement if it's not found, and the win object should be a stub object. Unfortunately, what happens is if the fmEditCheck form does not exist TC freezes for 10-20 seconds, and in the TC status bubble in the upper right hand of the screen it says "Waiting for the fmEditCheck object".
As a side note, setting the WaitTime parameter 0 does seem to work as intended, but it seems to miss the fmEditCheck form coming into existance. Also everything works fine when the fmEditCheck window does exist
var rde = Aliases["WinRDE"];
var win;
win = rde[wac]("fmEditCheck", 5);
if (win["Exists"])
{
..... code ....
}
With this code, if fmEditCheck exists, everything is fine. If the fmEditCheck form does not exist, the code is *supposed* to wait for 5 milliseconds and then move on to the IF statement if it's not found, and the win object should be a stub object. Unfortunately, what happens is if the fmEditCheck form does not exist TC freezes for 10-20 seconds, and in the TC status bubble in the upper right hand of the screen it says "Waiting for the fmEditCheck object".
As a side note, setting the WaitTime parameter 0 does seem to work as intended, but it seems to miss the fmEditCheck form coming into existance. Also everything works fine when the fmEditCheck window does exist