Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Re: Application Object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Application Object
Divers
Thread ID:
00755742
Message ID:
00755742
Vues:
34
I have been attempting to write an Application Object which sets up the environment (set commands needed), set up the error handler and shutdown procedures, set up temp folder location, open Database and launch the main menu ...etc. The advantage would be to have self contained code whose class can be dropped in a project and most of the App foundation is created upon instantiating the App object in the main program leaving it lean.

The problem is when activating the 'shutdown' process, I get always an error ' THIS can only be used within a method'

In the 'init' method of the AppMgr class, I have: 'on shutdown do this.release'.

Its release method looks like:
*******
WAIT WINDOW 'Shutting Down...' TIMEOUT .5
CLEAR ALL
RELEASE ALL
HIDE WINDOW all
CLEAR EVENTS
********

The line containing 'read events' is where the program crashes when I step through the code. I placed that line in both the main.prg and the 'init' method of the class with no sucess in both cases.

I use VFP 7.0 SP1.

Any theories as to why this error takes place?

Many thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform