Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form crashes foxpro
Message
From
28/09/2001 21:49:00
 
 
To
21/09/2001 09:07:25
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00559199
Message ID:
00562195
Views:
26
>I have a form which opens a linked child form. When the child form is closed, it sets a flag on the parent form, and a timer on the parent form causes it to close.
>
>Everything seems to work fine.
>
>HOWEVER, after opening and closing the child form one or two times (and thereby closing the parent form), FoxPro literally crashes when I try to open up the forms another time. The error is:
>
>VFP6 caused an invalid page fault in module VFP6.EXE at 0177:004052e3...
>
>I have looked at the forms have not noticed anything odd about them. They both have private data sessions, and the child has a few pages with several controls on it.
>
>Does anyone have a suggestion on where to begin to try to solve this problem? I really appreciate any help you can offer.
>
>Sincerely,
>
>Lev Seltzer




Lazy way to do:
Don't close child form, instead, hide it by ThisForm.Hide

Parent only call it visible when use..

but you need to do more coding on Application quit.

2nd way to do:
Try Highest call instead of This.Parent...., ThisForm.CallForm...

For iX = 1 to _SCREEN.FormCount
IF _SCREEN.Forms[iX].Caption = [My parent] && or class or any special notice.
...
ENDIF
EndFor

3rd way to do:
if you got reference on it..
Empty it when close!!

Thisform.CallForm = []

If Any form got a variable reference outside, it can't close until the variable release the reference.
but as you need to check more, it may fail to do.
One easy method is to make the form.closable as .F.
and you empty the reference on ChildForm.Destroy()


Conclusion:
I choose 1st way because I am lazy to debug but I know it is no good at all.
only fast on 2nd call child form (skip most init time, instead, refresh time)

3rd way will be the normal do, but you need check more errors.
you can combine 2nd and 3rd on use. :)
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Reply
Map
View

Click here to load this message in the networking platform