par Michael DELIQUE » 15 Fév 2008 à 10:06
salut
génial, ça permet de faire un RunOnServer qui ne bloque pas le client... pour lancer un agent en dev c'est top !
j'en ai fait une fonction
- Code : Tout sélectionner
Public Sub AgentTellRunOnServer(wDB As Notesdatabase, wAgent As String)
Dim Session As NotesSession
Dim DBAgent As NotesDatabase
On Error Goto ErrorHandle
If Trim(wAgent)="" Then
Error 9999,"Pas de nom d'agent"
Exit Sub
End If
Set Session = New NotesSession
If wDB Is Nothing Then
Set DBAgent = Session.CurrentDatabase
Else
Set DBAgent = wDB
End If
If DBAgent.GetAgent(Trim(wAgent)) Is Nothing Then
Error 9999, "Agent inconnu ("+DBAgent.FilePath+") => "+wAgent
End If
Call Session.SendConsoleCommand(DBAgent.Server, {Tell amgr run "}+DBAgent.FilePath+{" '}+Trim(wAgent)+{'})
Set DBAgent = Nothing
Exit Sub
ErrorHandle:
Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
Exit Sub
End Sub
Cordialement
Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN