I finally got around to testing this. Unfortunately, it doesn't seem to work, at least from the command window. The call to .Dispose( ) hangs, and requires manually killing the COM EXE in Windows Task Manager.
Am I missing something?
>Hi Al,
>
>I know I read somewhere that setting the variable to null is all you need to do but if you look at Rick's classes at West-wind, he uses a dispose() method that does release this. I found this to fix some strange problems I had releasing objects. I think I read post from Rick that this fixed some strange problems he had releasing com objects.
>
>
>loEXECOMServer = CREATEOBJECT( "MyEXECOMServerName.FLocker" )
>loEXECOMServer.dispose()
>
>DEFINE CLASS FLocker AS Session OLEPUBLIC
> * DataSession = 2 (Private Data Session) is the default for the Session class
>
> FUNCTION Init
> SET EXCLUSIVE OFF
> SET TABLEVALIDATE TO 0
>
> ENDFUNC
>
> FUNCTION dispose()
> release this
> ENDFUNC
>
> FUNCTION TableLock ( tcTable AS String, tcAlias AS String ) AS VOID
> USE ( tcTable ) ALIAS ( tcAlias ) IN 0 SHARED NODATA NOUPDATE
> =FLOCK( tcAlias )
>
> ENDFUNC
>
> FUNCTION TableUnlock ( tcAlias AS String ) AS VOID
> UNLOCK IN ( tcAlias )
> USE IN ( tcAlias )
>
> ENDFUNC
>
>ENDDEFINE
>
>
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up