i saw WMI Sample which use Function WMIService()
x:\fwh\samples\pcinfo.prg
Question : how to "destroy" WMI Connection ?
- Code: Select all Expand view RUN
- oLocator := CreateObject( "wbemScripting.SwbemLocator" )
oWMI := oLocator:ConnectServer()
oLocator := CreateObject( "wbemScripting.SwbemLocator" )
oWMI := oLocator:ConnectServer()
Antonio Linares wrote:Try with:
oWMI := nil
function WMIService()
// It would be useful to keep this function in the library
static oWMI
local oLocator
if oWMI == nil
oLocator := CREATEOBJECT( "wbemScripting.SwbemLocator" )
oWMI := oLocator:ConnectServer()
endif
return oWMI
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Danielmaximiliano and 36 guests