i want to run a WMI Script. i found c:\MiniGUI\SAMPLES\Advanced\WMI_Service\ and Demo work
so i take FUNCTION WMIService() ... but it make Problem
i does run with Debugger but crash without it
i have modify Code this Way
Code: Select all
STATIC FUNCTION WMIService()
*-----------------------------
Static oWMI
Local oLocator
if oWMI == NIL
oLocator := CreateObject( "wbemScripting.SwbemLocator" )
ALTD()
IF EMPTY(oLocator)
msginfo("can not create wbemScripting.SwbemLocator")
ELSE
hb_idleSleep(1)
// this line crash without Debugger
oWMI:= oLocator:ConnectServer()
ENDIF
endif
Return oWMI
i also include a hb_idleSleep(1) but it does not help.Error WINOLE/1007 Ein ausgehender Aufruf kann nicht ausgeführt werden, da die Anwendung einen eingabe-synchronisierten Aufruf weiterleitet. (0x8001010D): SWbemLocator (DOS Error -2147352567)
Called from TOLEAUTO:CONNECTSERVER(0)
Called from WMISERVICE(146)
Called from WMI_INFO(117)
Called from USB_DETECT(72)
Called from EVENTPROCESS(161)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5737)
Called from MAIN(35)
why does it run with Debugger but not without