Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RELEASEing an EXE COM Server
Message
De
22/02/2012 18:07:12
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
À
22/02/2012 15:47:01
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Divers
Thread ID:
01534159
Message ID:
01536189
Vues:
38
I looked at some old code and it looks like dispose is used to cleanup before destroying an object. So I would try this.
function dispose()
   * do any cleanup here
   quit
endfunc
I can't remember how Rick cleans up com exes in west-wind but this seems to make since.

>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
>>
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform