I have created several different forms - but now I want to run them from an ABL window that is already running persistently (can't change that for the moment)
I can do
but I don't want to have to specify the form name in a big case statement
what is the way round this ? DYNAMIC-NEW ?
Something like this should work:
def var myForm as Progress.Windows.Form.
def var i as int.
def var cForms as char initial "someform1,someform2".
do i = 1 to num-etries(cForms):
myForm = dynamic-new entry(i, cForms).
myForm:show().
end.
yeah, thanks for that.
However, I now get a 13967 error when I run the form ...
"You can only use a .NET-specific input-blocking statement (WAIT-FOR x:y()) once any .NET forms are shown (other than to wait for an ABL dialog box)"
I need to be able to run a .net form from my existing abl application.
yikes, a bit of a kludge, but it works ...
create a form, make it 0% opacity, don't show in titlebar
create the new form
run the ABL app startup procedure persistently
WAIT-FOR Application:Run(myinvisibleform)
this allows the abl to run ok, and from a .w file to create a new .net form and show it
Is there an easier way ?
Can you modify the one and only WAIT-FOR of the application from some
WAIT-FOR CLOSE OF THIS-PROCEDURE or
WAIT-FOR CLOSE OF wWin (the persistent window)
to
WAIT-FOR System.Windows.Forms.Application:Run (). /* no parameter to the run */
Then you'll be in the context of .NET event handling - it should solve your input blocking issue as well.
You'll then need a ON CLOSE OF THIS-PROCEDURE or CLOSE O wWin event handler, that runs
System.Windows.Forms.Application:Exit().
to bypass the WAIT-FOR Application:Run().
of course, the simple solution works best. Thanks Mike - works just great.
of course, the simple solution works best. Thanks
Mike - works just great.
Crap. Works just great in an OEA environment. Move it to a non-OEA (i.e. production) and it craps out with
"The WAIT-FOR format (WAIT-FOR x:y()) cannot be used without any instantiated .NET objects (14067)"
Quote from Peter Judge:
"Yep. You might have to create a dummy Form, since the Application:Run() method wants at least one form in the session. But that dummy form doesn't need to be anything more than dummyForm = new P.W.Form()."
erk. Found a workaround.
put the following just before the wait-for.
still seems daft ...
My assumption is, that the CLR need to be loaded before the WAIT-FOR.
That was the case in my boot loaded routines because I probably accessed the Registry using .NET classes.
How about using a System.Object. That gives you the smallest footprint before the WAIT-FOR ?