Releases an object from the Visual FoxPro API data pool.
void _FreeObject(Value FAR *objct)
Use _FreeObject(В ) to free an object from the Visual FoxPro API object table.
_FreeObject(В )is used in the following cases:
1. If an object reference is returned from any Visual FoxPro API function (for example, _Evaluate(В ) or _GetObjectProperty(В )), you must use _FreeObject(В ) to release the object when you are no longer using it.
2. If you keep a reference to an object across different Visual FoxPro API calls, you must first use _ObjectReference(В ) to increment the count for the object. When you are no longer using the object, you must then use _ObjectRelease(В ) to decrement the count for the object and then use _FreeObject(В ) to release the object.
In addition to the previous rules, you should always clear the Value structure you pass to any Visual FoxPro API function that returns a value into the passed Value structure. For example, you can create and call a function that clears the structure prior to calling any function that returns a value into your structure. You can also create and call a function to cleanup any object references or unused handles.
0 is returned unless an error occurs. When an error occurs, a negative number representing an internal error code is returned.
For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.