Visual Basic para Aplicaciones - recursos del sistema y shell

Life is soft - evento anual de software empresarial
 
Vista:

recursos del sistema y shell

Publicado por axe (11 intervenciones) el 31/10/2004 20:25:20
Chicos,

Tengo un problema que no logro resolver, he realizado un programa que ejecuta una serie de batch de comandos , para mas pistas , lanza secuencias de whois ,pings y nslookup.
Despues de funcionar un buen rato me da el simpatico error de recursos del sistema insuficientes.

Esta claro que cada cierto rato deberia recuperar recursos del sistema para reutilizarlos. ¿ Alguna idea ?

Para lanzar los comandos uso Lib "kernel32"

con este codigo de ejecutar comando:
Public Sub StartProcess(CommandLine As String, Optional Hide As Boolean = False)
Const STARTF_USESHOWWINDOW As Long = &H1
Const SW_HIDE As Long = 0
Const HIGH_PRIORITY_CLASS As Long = 0
Const INFINITE As Long = &HFFFFFFFF

Dim proc As PROCESS_INFORMATION
Dim Start As STARTUPINFO
Dim fso
Dim filePath, Path, Path1 As String
Dim strCMD As String
Dim existe_fichero As Boolean
Dim ret
Dim cwd As String
Dim length As Long
Dim var As String
Dim ExecCmd
'Initialize the STARTUPINFO structure:
Start.cb = Len(Start)
If Hide Then
Start.dwFlags = STARTF_USESHOWWINDOW
Start.wShowWindow = SW_HIDE
End If
'Start the shelled application:
CreateProcessA 0&, CommandLine, 0&, 0&, 1&, _
HIGH_PRIORITY_CLASS, 0&, 0&, Start, proc

ret = WaitForSingleObject(proc.hProcess, 2000)
Call GetExitCodeProcess(proc.hProcess, ret)
Call CloseHandle(proc.hThread)
Call CloseHandle(proc.hProcess)
ExecCmd = ret
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder