Kbase P182845: 4GL/ABL: How to determine whether there is a .NET form in the current ABL session?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/1/2011 |
|
Status: Unverified
GOAL:
4GL/ABL: How to determine whether there is a .NET form in the current ABL session?
GOAL:
How to determine at runtime whether to use the ABL only WAIT-FOR syntax or the GUI for .NET WAIT-FOR syntax?
FACT(s) (Environment):
Windows
OpenEdge 10.2B
FIX:
Run code similar to the following snippet to determine the existence of .NET form in the current ABL session. The following code snippet, returns System.Type[] if there is a .NET form or more in the session is in the session. It may be re-written as a logical function to returns yes or no when checking forms in the current session:
DEFINE VARIABLE rForm AS CLASS Progress.Windows.Form NO-UNDO.
DEFINE VARIABLE rIForm AS CLASS Progress.Windows.IForm NO-UNDO.rIForm = SESSION:FIRST-FORM.
DO WHILE VALID-OBJECT( rIForm ):
rForm = CAST(rIForm, Progress.Windows.Form) NO-ERROR.
IF rForm <> ? THEN
MESSAGE rForm:GetType():GetInterfaces()
VIEW-AS ALERT-BOX INFORMATION.
rIForm = rIForm:NextForm.
END.
If the result returned by the code above indicates the existence of .NET forms, the GUI for .NET WAIT-FOR syntax. Other wise, use the ABL only WAIT-FOR syntax.