I need some help...
When closing our application we are getting the error message "The
instruction at "0x02245e30" referenced memory at "0x02245e30". The memory
could not be "read"".
We don't know what is wrong... any suggestions on how to fix this
Any input would be really appreciated.

Memory access error
JonathanCox
Sounds like you may have a dangling references to an object, left over from a form object that was not closed properly or set to .null..
Do you have an Active X object on your forms
smitten94
>> Where do I type this "Set to null" instruction
Depends where the references are held. For example in the Unload of a form that references an ActiveX control you would use:
ThisForm.oActivex = NULL
If the references are Public Variables (or are variables created in the Start-up routine) then in your shutdown routine you would use code like:
goActiveX = NULL
But its not just ActiveX controls. The same is true for any references that are held by a form to other VFP objects that are not contained in that form.
VFP is very good at 'garbage collection' when the objects are directly contained in the form. What it cannot do is resolve reference to objects that exist outside the form. So if you have code like:
ThisForm.oTimer = CREATEOBJECT( "timer" )
That timer is NOT a child object of the form and you should explicitly clear the reference when releasing the form.
Thisform.oTimer = NULL
But if you have code like this:
ThisForm.AddObject( 'oTimer', "TIMER" )
The the object IS a child of the form and VFP can reliably deal with it automatically.
Is that any clearer
Robert Darwin
I have another question...
Where do I type this "Set to null" instruction
Jeff Windsor
jefftardif
As Don said, this is typical of an ActiveX control that has not been closed properly - if you are using any such controls in your application make sure that all references to them have been cleared (set to NULL!) before shutting down the application.
This is not a VFP error directly - but is coming from the Windows layer where some memory location has become invalid.