I'm porting an old FoxPro app to Visual FoxPro. The old program of course did not use any classes, but I've started to use them for certain cases. This has caused a problem in the development cycle that I don't see mentioned anywhere.
Basically, if I create an object based on a class defined in a procedure file, then FoxPro will never let go of my APP. I can't delete it or rebuild it, and I have to restart VFP every time I make a change.
Steps to reproduce. Make a.prg
with
SET PROCEDURE TO b
m.test1 = CREATEOBJECT('TestClass')
RELEASE m.test1
and make b.prg
with
DEFINE CLASS TestClass AS Control
ENDDEFINE
Create a project called a
:
MODIFY PROJECT a
And add the program a.prg
. Then
BUILD APP a FROM a
DO a.app
DELETE FILE a.app
The last line will give
Application file 'c:\...\b.fxp' is not closed
Then if you try the DELETE
again, it will say
File access is denied c:\...\a.app
I can see in Process Explorer that vfp9.exe
has a handle on the APP file that never goes away until I quit FoxPro, no matter what I try:
- SET PROCEDURE TO
- CLOSE ALL
- RELEASE ALL
- CANCEL
- CLEAR ALL
- ad nauseum
build app a from a
command becuase it will throw afile a.pjx does not exist
error. Do you have a a.pjx file? Perhaps version 9.0 is different? – DaveB