Lotus Notes / Domino Sonstiges > Java und .NET mit Notes/Domino

Java Agent ruft externes Programm auf und liefert Rückgabewerte...

(1/6) > >>

CLI_Andreas_Schmidt:

Hallo @Kaffeetrinker,

Ich möchte eine exe aufrufen, im geöffneten Frontend etwas eintragen und dann die Rückgabewerte weiterverarbeiten.

Der Aufruf kommt soll aus einer Notes Ansicht erfolgen.

JAVA oder nicht JAVA ?

Ich denke java ist hier die richtige Wahl oder ?

jBubbleBoy:
Und warum nicht LotusScript?

CLI_Andreas_Schmidt:
In Script habe ich noch keine Lösung gefunden wo ein Programm auf ein anderes wartet.

jBubbleBoy:
Wie möchtest Du das denn in Java machen?
In LS geht das z.B. so, auch könnte man das über eine BAT-Datei "händeln" (simulieren).


--- Code: ---     Print "Calc.exe wird gestartet"
     ShellAndWait("Calc.exe")
     Print "Calc.exe wurde beendet"
 
Public Type STARTUPINFO
  cb As Long
  lpReserved As String
  lpDesktop As String
  lpTitle As String
  dwX As Long
  dwY As Long
  dwXSize As Long
  dwYSize As Long
  dwXCountChars As Long
  dwYCountChars As Long
  dwFillAttribute As Long
  dwFlags As Long
  wShowWindow As Integer
  cbReserved2 As Integer
  lpReserved2 As Long
  hStdInput As Long
  hStdOutput As Long
  hStdError As Long
End Type

Public Type PROCESS_INFORMATION
  hProcess As Long
  hThread As Long
  dwProcessID As Long
  dwThreadID As Long
End Type

Declare Function WaitForSingleObject Lib "kernel32" (Byval _
  hHandle As Long, Byval dwMilliseconds As Long) As Long

Declare Function CreateProcessA Lib "kernel32" (Byval _
  lpApplicationName As Long, Byval lpCommandLine As String, Byval _
  lpProcessAttributes As Long, Byval lpThreadAttributes As Long, _
  Byval bInheritHandles As Long, Byval dwCreationFlags As Long, _
  Byval lpEnvironment As Long, Byval lpCurrentDirectory As Long, _
  lpStartupInfo As STARTUPINFO, lpProcessInformation As _
  PROCESS_INFORMATION) As Long

Declare Function CloseHandle Lib "kernel32" (Byval _
  hObject As Long) As Long

Public Const NORMAL_PRIORITY_CLASS = &H20&
Public Const INFINITE = -1&

Public Sub ShellAndWait(Byval RunProg As String)
  Dim RetVal As Long
  Dim proc As PROCESS_INFORMATION
  Dim StartInf As STARTUPINFO
  StartInf.cb = Len(StartInf)
  'Execute the given path
  RetVal = CreateProcessA(0&, RunProg, 0&, 0&, 1&, _
  NORMAL_PRIORITY_CLASS, 0&, 0&, StartInf, proc)
  'Disable this app until the shelled one is done
  RetVal = WaitForSingleObject(proc.hProcess, INFINITE)
  RetVal = CloseHandle(proc.hProcess)
End Sub

--- Ende Code ---

m3:
Das ist aber eher LS & Win32. ;)
Und wenn ich das unter 8.5 unter Ubuntu laufen lasse?  >:D

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln