Running several different forms

Posted by jmls on 14-Jan-2009 13:12

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 ?

All Replies

Posted by Simon de Kraa on 14-Jan-2009 15:03

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.

Posted by jmls on 14-Jan-2009 15:18

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.

Posted by jmls on 14-Jan-2009 15:47

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 ?

Posted by Admin on 14-Jan-2009 23:28

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().

Posted by jmls on 15-Jan-2009 00:48

of course, the simple solution works best. Thanks Mike - works just great.

Posted by jmls on 15-Jan-2009 01:32

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)"

Posted by rbf on 15-Jan-2009 01:49

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()."

Posted by jmls on 15-Jan-2009 01:52

erk. Found a workaround.

put the following just before the wait-for.

still seems daft ...

Posted by Admin on 15-Jan-2009 02:07

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 ?

This thread is closed