21/08/09 14:13
fusebyte
Usando questa funzione ottengo questo "error runtime" .
Il codice funziona,killa l'applicazone anche se ha più instanze,ma in chiusura se ne esce con questo errore,del quale non riesco ad trovare niente al riguardo.
Sapreste dirmi dove agire per sistemare le cose?
Grazie
Private Sub Form_Load() TerminateProcess ("Icon.exe") End Sub
Public Sub TerminateProcess(ByVal ProcessName As String) Dim oLoc Dim oServ Dim oObjectSet Dim oProc Dim sWQL As String Yes = True ' genera la query WQL sWQL = "SELECT * FROM Win32_Process WHERE Name = '" & ProcessName & "'" ' oggetto locator Set oLoc = CreateObject("WbemScripting.sWbemLocator") Set oServ = oLoc.ConnectServer(".", "root\cimv2") Set oObjectSet = oServ.ExecQuery(sWQL) For Each oProc In oObjectSet If Yes = True Then oProc.Terminate <---error runtime 2147217406 Next Set oProc = Nothing Set oObjectSet = Nothing Set oServ = Nothing Set oLoc = Nothing End Sub
Il codice funziona,killa l'applicazone anche se ha più instanze,ma in chiusura se ne esce con questo errore,del quale non riesco ad trovare niente al riguardo.
Sapreste dirmi dove agire per sistemare le cose?
Grazie
Ultima modifica effettuata da fusebyte 21/08/09 14:18
aaa