| Recovery System |
Subsystem list |
Top level |
RECapplication object.
winclass RECunwantedWindows : RECbase;
window RECunwantedWindows grRECunwantedWindows;
boolean
| IsHappy
| (RECphase ePhase, boolean logFirstFailure)
|
boolean
| BeHappy
| (RECphase ePhase)
|
RECbase.IsHappy.
RECbase.BeHappy.
The obvious way to get rid of unwanted windows is to call the built-in
4Test method MainWin.GetCloseWindows which, contrary to its name,
returns a list of all the currently open windows in the application.
However, GetCloseWindows has a fatal flaw.
If you dynamically instantiate a window using a user-defined class,
the corresponding window returned by GetCloseWindows
will not be of the user-defined class, but of the built-in 4Test class
from which the user-defined class was derived.
Thus, for such a window, a recovery system based on GetCloseWindows
does not have access to any overridden methods. If you have to override
the Close method (as we do for many windows in the Media
Composer), you're screwed.
To make matters worse, if you have two dynamically instantiated windows
of different classes, but with the same caption, you won't be able to
tell one from the other, using the windows returned by GetCloseWindows.
The best solution seems to be to use an extension function in the
application to return a list of currently open windows.
Unfortunately, 4Test does not allow windows to be passing to or returned from
extension functions. Therefore, we use a string (RECwindowUid)
to represent a window. Encoded in the string is the class of the window
and its title, which we can use to unambiguously identify a window.