>This may appear unusual, but I have a VFP program which is a shell which will run another VFP .exe program.
>
>My shell code is roughly
>DO WHILE .T.
> IF ... && .exe has changed....
> CLEAR PROGRAM
> SET CLASSLIB TO && etc etc
> .
> DO (exename) && where 'exename' is the name of the new executable detected
> ENDIF
>ENDDO
>
>This all works fine and the shell program will fire up another exe without problem anytime I want except when the called exe contains a custom class declared in code.
>I can still run the new exe but for some reason the previous exe stays held open by the shell prgoram. That is if I try to delete the .exe file that is no longer used, I can't.
>If my 'exename' doesn't declare any classes I have no problems at all.
>TIA
Maybe there's an implicit "Set proc to old.exe" or it still has some references to any of the object whose classlibs (or their parents, grandparents or any of elders... up to monkeys) are within that .exe - you may just try to Set Proc To, and additionally check if there are any object references left at this moment.