Modal forms crash in DEV (fix)

The place where ProMatrix users can post coding tips and utilities they create.

Modal forms crash in DEV (fix)

Postby JessicaLawson » Sun Jun 13, 2010 4:19 pm

I'm now using VFP9/VPME9 but this also occured in VFP5/VPM5
Perhaps 20 of my form_toolbar forms in my large apps are MODAL
The problem has always been, and regretfully I just learned to live with it,
is that if you were editing the form from the Object builder and ran the
form from edit mode (Run Form) the modal forms would very often crash when
closing them, or going back into the form to work on them again. In VFP5 I
could easily get going again. In VPME9 I have to use TaskMan because the
crashes are more debilitating and it has become a real nuisance.
It is only with MODAL forms (WindowType=1 Modal) runing right from the OB
I tried changing it in the PEM sheet while working on the form but then
would often forget to set it back to MODAL.
I would think others have had this problem too.
I now have a simple but trusty fix. I monitor to see if the form is being
run in DEV or as an APP/EXE. Then if in DEV, I change the form to MODELESS
in the forms INIT, in the PRO CLASS. If it is being run normally from the
APP or EXE interface the form remaings modal.

This code goes in the ProClass Form_toolbar's INIT method somewhere after
the DODEFAULT()
Pete Ryder
IF This.WindowType=1.and.[FRMOBJECTBUILDER]$PROGRAM(1)

This.WindowType = 0 && change MODAL form to MODELESS when running in DEV
enviroment

ENDIF


by Pete Ryder
JessicaLawson
 
Posts: 79
Joined: Sun Jun 13, 2010 1:23 pm

Re: Modal forms crash in DEV (fix)

Postby JessicaLawson » Sun Jun 13, 2010 4:20 pm

I am running 6.0b
I didn't find any existing code in my PROFORMS.VCX form_toolbar.init
Did I misinterpret your instructions?

-Fred Wilson
JessicaLawson
 
Posts: 79
Joined: Sun Jun 13, 2010 1:23 pm

Re: Modal forms crash in DEV (fix)

Postby JessicaLawson » Sun Jun 13, 2010 4:20 pm

Hi Fred: VPME9 Does have some code in the INIT but possibly 6 does not. I
just checked VPM5 and it does not have code in the INIT.
If you add my code to the INIT then include a DODEFAULT() line before it.

Pete
JessicaLawson
 
Posts: 79
Joined: Sun Jun 13, 2010 1:23 pm


Return to ProMatrix User Library

Who is online

Users browsing this forum: No registered users and 1 guest

cron