Sys(3097), Sys(3098)
Starting with VFP 7, these functions increment and decrement the reference count for COM objects. Usage | nRefCount = SYS( 3097, oComObject ) nRefCount = SYS( 3098, oComObject ) |
Parameter | Value | Meaning |
oComObject | Object | The COM object for which you want to increment or decrement the reference count. |
nRefCount | Numeric | The current reference count. |
Example | * Here's an example of how this works: oExcel = CREATEOBJECT("Excel.Application") oExcel.Visible = .T. ? SYS(3097, oExcel) && Increment counter, shows 2 oExcel.Quit() && Excel disappears * Open the Task Manager, and see that the process EXCEL.EXE * is still running. ? SYS(3098, oExcel) && Decrement counter, shows 1, but && still in Task Manager Process List. ? SYS(3098, oExcel) && Decrement counter again, shows 0, and it && is gone from the Task Manager. * THIS IS NOT THE WAY TO CODE YOUR APPLICATION. THIS CODE * DEMONSTRATES THE EFFECTS OF THIS FUNCTION IN A SIMPLE MANNER * AND IS FOR DEMONSTRATION PURPOSES ONLY. |
See Also | Sys(), Sys(3095), Sys(3096) |
View Updates
Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.