Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unload form class issue with 'Too many windows open'
Message
De
16/06/2004 09:32:17
Andrew Fell-Gordon
Calypso Publications Ltd
Enfield, Royaume Uni
 
 
À
14/06/2004 21:09:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00912591
Message ID:
00914219
Vues:
13
The delay and the message still sounds as if you are opening the window in some sort of loop. To see if this is the case, why not put the following code into the load of the form class
Local lnX,lcCaller
*-- find the end of the call stack in vfp6
For lnX = 2 To 1000
  If Empty(Sys(16,lnX))
    Exit
  EndIf
Next

*-- last entry will be load, second last will be the load routine
lnX = lnX - 2

*-- write to a file, better to do this if there are a lot of
*-- forms than to keep clicking on a messagebox

StrToFile(Chr(13) + "Form " + this.Class + " called at " + Transform(Datetime()) + " by " + Sys(16,lnX),"openlog",.t.)
If you run a test using this code and there is only one entry in openlog then the problem is not a loop. if the file is full of entries then either the calling routine contains a loop or it is being called amny times.

Incidentally, are your form classes modal? if they are modeless then showing the form will not halt the parent code and it could go on to do other things (like starting the form again)

Hope this is some help, at least to eliminate my idea.

Best regards

Andrew

>My application give the runtime error 'Too many window open' after user
>use the menu to open the form and click the x button to close it. If
>we repeat it by opening and close the form, it will give the error.
>
>My form is all created using classes.
>Any ideal how to close all the classes as I suspect my form is not close properly.
>
>>Sounds as if you have got into some sort of loop. What code is run to load the form when the menu item is chosen?
>>
>>Andrew
>>
>>>Hi,
>>>
>>>My company application is created using VFP6 with SP5.
>>>All the form is created using classes.
>>>
>>>However, when user click the menu to activate which form,
>>>after some time, it will give error of "Too many windows open"
>>>
>>>How can I effective unload the individual form classes
>>>before opening the other form classess ?
>>>
>>>Any help or comment is very much appreciated. Thank you
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform