Child form using WAIT FOR

Mkontwg

Member
Hi Team

I need a help on this logic, I have a control called ultraExploreBar that has properties. But I want to create an event handler that will display a child form inside my parent form. My logic is as follow;

METHOD PUBLIC VOID DoWait():
DEF VAR hMain AS Client.ChildForm NO-UNDO.
ultraExplorerBar = NEW Client.ChildForm().
WAIT-FOR hMain:ShowDialog().
END METHOD.


I have tried to re-modified my code by using the logic below for more clarity;

@VisualDesigner.
METHOD PRIVATE VOID ultraexplorer_btn( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinExplorerBar.ItemEventArgs ):
THIS-OBJECT:hMain.
WAIT-FOR hMain:ShowDialog().
RETURN.
END METHOD.
 
Last edited:

Mkontwg

Member
Now I'm getting an exception for using WAIT-FOR statement;

METHOD PRIVATE VOID ultraexplorer_btn( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinExplorerBar.ItemEventArgs ):
THIS-OBJECT:ShowDialog().
WAIT-FOR hMain:ShowDialog().
hMain:Dispose().
RETURN.
END METHOD.
 

Attachments

  • exception.PNG
    exception.PNG
    42.3 KB · Views: 6

Mkontwg

Member
On my previous error I made a fix, now I'm getting this exception after using this logic below;

@VisualDesigner.
METHOD PRIVATE VOID ultraexplorer_btn( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinExplorerBar.ItemEventArgs ):
hMain = NEW Client.ChildForm().
hMain:Show().
WAIT-FOR System.Windows.Forms.Application:Run(hMain).

RETURN.
END METHOD.


How can I remove the error when the child form is displayed? Please help, thanks.
 

Osborne

Active Member
It sounds as though you have too many WAIT-FOR's taking place, because unless the form is a dialog box then you should just have one WAIT-FOR and that is the first program in the stack - one world, one wait-for.

Have a look at the following as they cover this point:

Progress KB - Error on second WAIT-FOR Application:Run usage
Can ABL window remain active when a .NET form is called? - Forum - OpenEdge Development - Progress Community
One World, One Wait-for - Forum - OpenEdge Development - Progress Community
http://www.consultingwerk.de/filead...arted_with_Embedded_Windows_and_WinKit_LE.pdf
 

Mkontwg

Member
Hi Thanks

The link helped, I only did the trick. But uncommenting one argument list from the method. See the changes, no exception afterward;

@VisualDesigner.
METHOD PRIVATE VOID ultraexplorer_btn( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinExplorerBar.ItemEventArgs ):
hMain = NEW Client.ChildForm().
//hMain:Show().
WAIT-FOR hMain:ShowDialog().

RETURN.
END METHOD.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Please use CODE tags to enclose your code in forum posts. It will make it much easier for the people helping you.

You can select Insert and then Code from the toolbar, or you can just type the tags like so:
[ code ]
your code goes here
[ /code ]

Note: I have typed them with spaces so they won't be turned into actual code tags.
 

Mkontwg

Member
Please use CODE tags to enclose your code in forum posts. It will make it much easier for the people helping you.

You can select Insert and then Code from the toolbar, or you can just type the tags like so:
[ code ]
your code goes here
[ /code ]

Note: I have typed them with spaces so they won't be turned into actual code tags.
Thanks Rob
 
Top