>>_Screen.AddObject("oResizer", "Resizer") >> >>DEFINE CLASS Resizer AS Custom >> oScreen = _Screen >> >> PROCEDURE oScreen.Resize >> WAIT window "Resizing" NOWAIT >> ENDPROC > >*-------------------------------------------- >* You can add a garbage collection method to your class >*-------------------------------------------- > Procedure Destroy > this.oScreen = .null. > EndProc >*-------------------------------------------- > > > >>ENDDEFINE >>>>
>>If Vartype(_Screen.oResizer) = 'O' > > >* Add this to remove hanging reference >*--------------------------------------------- > _Screen.oResizer.oScreen .Null. >*--------------------------------------------- > >> _Screen.RemoveObject("oResizer") >>Endif >>>>
>>File cannot be closed because outstanding references exist. >>>>
File cannot be closed because outstanding references exist.I made a small little test project and your solution works fine for it.