Ja, legst Dir halt ein Array von A: bis Z: an. Wenn Du irgend ein Problem bei der Umsetzung hast, einfach melden!
Beiträge von teh_hahn
-
-
Ja, wie gesagt, baust Dir ein Array:
Spoiler anzeigen
[autoit]Local $i_drives = 5
[/autoit]
Local $a_driveletters[$i_drives] = ["C:", "D:", "E:", "F:", "G:"]
Local $a_drivetotalspaces[$i_drives] = [-1, -1, -1, -1, -1]
oder halt soviele wie Du hast und dann machst ne For-Schleife:Spoiler anzeigen
[autoit]For $i = 0 To UBound($a_driveletters, 1) - 1 Step 1
[/autoit]
If DriveGetType($a_driveletters[$i]) = "Fixed" Then
$a_drivetotalspaces[$i] =DriveSpaceTotal($a_driveletters[$i] & "\")
EndIf
Next
usw. Kannst dann ja beliebieg aufbohren, wenn Du dann alle Infos hast schickst Du sie per SMTP weg - fertig... -
Ja, bastelst halt einen "Client", der Systeminfos sammelt. Identifizieren kannst Du doch den Server anhand seines Hostnames / IP-Adresse (Könnte der Betreff sein, z.B. "SysReport from [HOSTNAME] " & _Now()" oder so.
Dann bastelst Dir eine Config (am leichtesten INI) und schreibst da Empfänger usw. rein, halt alles was dynamisch sein soll. Dann schreibst Dir ein Skript, was ein Netzlaufwerk zu jedem Server aufmacht, das SysReport Skript rüberkopiert und dann führst du es mit PSExec.exe oder so aus...PS: Was meinst Du mit Festplattenbezeichnung? Kannst doch auch alles dynamisch halten...
-
ROFL!
Ich hab es jetzt... Ich Paddel frag die Ganze Zeit mit DeviceID=1 ab, das erste Device ist aber 0... Tja, manchmal sinds die kleinen Dinge.
So jetzt: VIELEN DANK!
-
Hi,
habe das _ClewareResetDevice($h_dll, $ptr_cusbaccess, 1) jetzt rausgenommen. Und mit dem Rückgabewert hast Du Recht, hab mich falsch ausgedrückt. Wenn ich das aber richtig verstehe, dann beinhaltet
[autoit]$d_temperature = DllStructGetData($struct_temp, 1)
[/autoit]
$i_time = DllStructGetData($struct_time, 1)
ja die Temperatur und die Zeit. Habs jetzt mal richtig gestellt mit der Abfrage des Rückgabewertes der Funktion, aber sie lässt sich nicht aufrufen...Am Gerät kann es nicht liegen. Mit dem C++ Tool kappt es wie gesagt...
Spoiler anzeigen
[autoit]#NoTrayIcon
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
#include <GUIConstants.au3>
Opt("GUICloseOnESC", 0)
Opt("MustDeclareVars", 1)
Opt("RunErrorsFatal", 0)main()
[/autoit] [autoit][/autoit] [autoit]Func _ClewareInit($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $ptr_cw = DllCall($h_dll, "ptr", "_FCWInitObject@0")
If IsArray($ptr_cw) == 0 Or $ptr_cw[0] == 0 Then
MsgBox(16, "Error", "Invalid address on FCWInitOject!")
Exit (1)
EndIfReturn ($ptr_cw[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareInitFunc _ClewareUnInit($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "ptr", "_FCWUnInitObject@4", "ptr", $ptr_cusbaccess)
EndFunc ;==>_ClewareUnInitFunc _ClewareOpen($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
Local $i_cwdevices = DllCall($h_dll, "int", "_FCWOpenCleware@4", "ptr", $ptr_cusbaccess)Return ($i_cwdevices[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareOpenFunc _ClewareClose($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "int", "_FCWCloseCleware@4", "ptr", $ptr_cusbaccess)
EndFunc ;==>_ClewareCloseFunc _ClewareGetDLLVersion($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $i_cwversion = DllCall($h_dll, "int", "_FCWGetDLLVersion@0")Return ($i_cwversion[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareGetDLLVersionFunc _ClewareResetDevice($h_dll, $ptr_cusbaccess, $i_device)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "int", "_FCWResetDevice@8", "ptr", $ptr_cusbaccess, "int", $i_device)
EndFunc ;==>_ClewareResetDeviceFunc _ClewareGetTemperature($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
Local $a_cwtempsuccess = -1
Local $struct_time, $struct_temp, $i_cwtempsuccess, $i_deviceid, $i_time = 0
Local $d_temperature = 0.0$i_deviceid = _ClewareOpen($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
If $i_deviceid >= 1 Then
MsgBox(64, "Cleware", "Number of Devices: " & $i_deviceid)
;~ _ClewareResetDevice($h_dll, $ptr_cusbaccess, 1)$struct_time = DllStructCreate("int")
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($struct_time, 1, 0)
$struct_temp = DllStructCreate("double")
DllStructSetData($struct_temp, 1, 0)
$a_cwtempsuccess = DllCall($h_dll, "int", "_FCWGetTemperature@16", _
"ptr", $ptr_cusbaccess, _
"int", 1, _
"ptr", DllStructGetPtr($struct_temp), _
"ptr", DllStructGetPtr($struct_time))
_ArrayDisplay($a_cwtempsuccess)
If $a_cwtempsuccess[0] == 0 Then
MsgBox(64, "Error", "Error on FCWGetTemperature!")
Else
Select
Case @error == 0
$d_temperature = DllStructGetData($struct_temp, 1)
$i_time = DllStructGetData($struct_time, 1)
MsgBox(64, "Cleware", "Temperature: " & $d_temperature & " °C." & @CR & "Time: " & $i_time & ".")
Case @error == 1
MsgBox(16, "Error", "Unable to use DLL.")
Case @error == 2
MsgBox(16, "Error", "Unknown return type.")
Case @error == 3
MsgBox(16, "Error", "Function not found in DLL.")
EndSelect
EndIf
EndIf
EndFunc ;==>_ClewareGetTemperatureFunc main()
[/autoit] [autoit][/autoit] [autoit]
Local Const $S_APPTITLE = "Get USBTemp"
Local Const $S_APPVERSION = "1.0"
Local Const $S_DLLPATH = @ScriptDir & "\USBaccess.dll"
Local $a_msg = -1Local $h_maingui = GUICreate($S_APPTITLE & " v" & $S_APPVERSION, 320, 240, -1, -1)
[/autoit] [autoit][/autoit] [autoit]
Local $h_readtempbt = GUICtrlCreateButton("&Read Temperature", 10, 10, 120, 20)
Local $h_readversionbt = GUICtrlCreateButton("&DLL Version", 160, 10, 120, 20)Local $h_dll = DllOpen($S_DLLPATH)
[/autoit] [autoit][/autoit] [autoit]
If $h_dll == -1 Then
MsgBox(16, "Error", 'Unable to open "' & $S_DLLPATH & '".')
Exit (1)
EndIf
Local $ptr_cusbaccess = _ClewareInit($h_dll)GUISetState(@SW_SHOW, $h_maingui)
[/autoit]
While 1
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop 1
Case $a_msg[0] == $h_readtempbt
_ClewareGetTemperature($h_dll, $ptr_cusbaccess)
Case $a_msg[0] == $h_readversionbt
MsgBox(64, "Cleware", "DLL Version: " & _ClewareGetDLLVersion($h_dll))
EndSelect
WEnd
GUIDelete($h_maingui)
_ClewareUnInit($h_dll, $ptr_cusbaccess)
DllClose($h_dll)
Exit (0)
EndFunc ;==>main -
Oh, das hatte ich ja ganz übersehen. hab mir nochmal die Doku angeschaut. ich dachte bislang die Funktion liefert nur einen Wert zurück und zwar die Temperatur, also müssen wir die Werte aus dem Struct auslesen.
Hab meinen Code mal eben vervollständigt, aber beide Werte geben nur 0 zurück, was für einen Fehler steht.
Spoiler anzeigen
[autoit];~ Including external files / Changing the operation of AutoIt functions/parameters.
[/autoit] [autoit][/autoit] [autoit]
;~ ----------------------------------------------------------------------------
#NoTrayIcon
#include <Array.au3>
#include <GUIConstants.au3>
Opt("GUICloseOnESC", 0)
Opt("MustDeclareVars", 1)
Opt("RunErrorsFatal", 0)
;~ -----------------------------------------------------------------------------
main()Func _ClewareInit($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $ptr_cw = DllCall($h_dll, "ptr", "_FCWInitObject@0")
If IsArray($ptr_cw) == 0 Or $ptr_cw[0] == 0 Then
MsgBox(16, "Error", "Invalid address on FCWInitOject!")
Exit (1)
EndIfReturn ($ptr_cw[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareInitFunc _ClewareUnInit($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "ptr", "_FCWUnInitObject@4", "ptr", $ptr_cusbaccess)
EndFunc ;==>_ClewareUnInitFunc _ClewareOpen($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
Local $i_cwdevices = DllCall($h_dll, "int", "_FCWOpenCleware@4", "ptr", $ptr_cusbaccess)Return ($i_cwdevices[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareOpenFunc _ClewareClose($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "int", "_FCWCloseCleware@4", "ptr", $ptr_cusbaccess)
EndFunc ;==>_ClewareCloseFunc _ClewareGetDLLVersion($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $i_cwversion = DllCall($h_dll, "int", "_FCWGetDLLVersion@0")Return ($i_cwversion[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareGetDLLVersionFunc _ClewareResetDevice($h_dll, $ptr_cusbaccess, $i_device)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "int", "_FCWResetDevice@8", "ptr", $ptr_cusbaccess, "int", $i_device)
EndFunc ;==>_ClewareResetDeviceFunc _ClewareGetTemperature($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
Local $struct_time, $struct_temp, $i_deviceid, $i_time = 0
Local $d_temperature = 0.0$i_deviceid = _ClewareOpen($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
If $i_deviceid == 1 Then
MsgBox(64, "Cleware", "Number of Devices: " & $i_deviceid)
_ClewareResetDevice($h_dll, $ptr_cusbaccess, 1)$struct_time = DllStructCreate("int")
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($struct_time, 1, 0)
$struct_temp = DllStructCreate("double")
DllStructSetData($struct_temp, 1, 0)
DllCall($h_dll, "int", "_FCWGetTemperature@16", _
"ptr", $ptr_cusbaccess, _
"int", 1, _
"ptr", DllStructGetPtr($struct_temp), _
"ptr", DllStructGetPtr($struct_time))
Select
Case @error == 0
$d_temperature = DllStructGetData($struct_temp, 1)
$i_time = DllStructGetData($struct_time, 1)
MsgBox(64, "Cleware", "Temperature: " & $d_temperature & " °C." & @CR & "Time: " & $i_time & ".")
Case @error == 1
MsgBox(16, "Error", "Unable to use DLL.")
Case @error == 2
MsgBox(16, "Error", "Unknown return type.")
Case @error == 3
MsgBox(16, "Error", "Function not found in DLL.")
EndSelect
EndIf
EndFunc ;==>_ClewareGetTemperatureFunc main()
[/autoit] [autoit][/autoit] [autoit]
Local Const $S_APPTITLE = "Get USBTemp"
Local Const $S_APPVERSION = "1.0"
Local Const $S_DLLPATH = @ScriptDir & "\USBaccess.dll"
Local $a_msg = -1Local $h_maingui = GUICreate($S_APPTITLE & " v" & $S_APPVERSION, 320, 240, -1, -1)
[/autoit] [autoit][/autoit] [autoit]
Local $h_readtempbt = GUICtrlCreateButton("&Read Temperature", 10, 10, 120, 20)
Local $h_readversionbt = GUICtrlCreateButton("&DLL Version", 160, 10, 120, 20)Local $h_dll = DllOpen($S_DLLPATH)
[/autoit] [autoit][/autoit] [autoit]
If $h_dll == -1 Then
MsgBox(16, "Error", 'Unable to open "' & $S_DLLPATH & '".')
Exit (1)
EndIf
Local $ptr_cusbaccess = _ClewareInit($h_dll)GUISetState(@SW_SHOW, $h_maingui)
[/autoit]
While 1
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop 1
Case $a_msg[0] == $h_readtempbt
_ClewareGetTemperature($h_dll, $ptr_cusbaccess)
Case $a_msg[0] == $h_readversionbt
MsgBox(64, "Cleware", "DLL Version: " & _ClewareGetDLLVersion($h_dll))
EndSelect
WEnd
GUIDelete($h_maingui)
_ClewareUnInit($h_dll, $ptr_cusbaccess)
DllClose($h_dll)
Exit (0)
EndFunc ;==>main -
Ah ja, jetzt seh ich das auch (hab die Sternchen übersehen :D). Ergibt ja auch Sinn mit dem Struct (hab noch nie so wirklich was mit DLLs in AutoIt gemacht - begreife aber so langsam aber sicher...)
Irgendwie funzt das aber immer noch nicht. Wenn ich mir die Werte in einem Array ausgeben lassen, so stehen da anscheinend nur die Speicheradressen drin. Wie komm ich den jetzt an die Temperatur?
Spoiler anzeigen
[autoit];~ Including external files / Changing the operation of AutoIt functions/parameters.
[/autoit] [autoit][/autoit] [autoit]
;~ ----------------------------------------------------------------------------
#NoTrayIcon
#include <Array.au3>
#include <GUIConstants.au3>
Opt("GUICloseOnESC", 0)
Opt("MustDeclareVars", 1)
Opt("RunErrorsFatal", 0)
;~ -----------------------------------------------------------------------------
main()Func _ClewareInit($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $ptr_cw = DllCall($h_dll, "ptr", "_FCWInitObject@0")
If IsArray($ptr_cw) == 0 Or $ptr_cw[0] == 0 Then
MsgBox(16, "Error", "Invalid address on FCWInitOject!")
Exit (1)
EndIfReturn ($ptr_cw[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareInitFunc _ClewareUnInit($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "ptr", "_FCWUnInitObject@4", "ptr", $ptr_cusbaccess)
EndFunc ;==>_ClewareUnInitFunc _ClewareOpen($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
Local $i_cwdevices = DllCall($h_dll, "int", "_FCWOpenCleware@4", "ptr", $ptr_cusbaccess)Return ($i_cwdevices[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareOpenFunc _ClewareClose($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "int", "_FCWCloseCleware@4", "ptr", $ptr_cusbaccess)
EndFuncFunc _ClewareGetDLLVersion($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $i_cwversion = DllCall($h_dll, "int", "_FCWGetDLLVersion@0")Return ($i_cwversion[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareGetDLLVersionFunc _ClewareResetDevice($h_dll, $ptr_cusbaccess, $i_device)
[/autoit] [autoit][/autoit] [autoit]
DllCall($h_dll, "int", "_FCWResetDevice@8", "ptr", $ptr_cusbaccess, "int", $i_device)
EndFunc ;==>_ClewareResetDeviceFunc _ClewareGetTemperature($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
Local $i_deviceid, $i_time, $d_temperature, $a_cwtemperature = -1$i_deviceid = _ClewareOpen($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
If $i_deviceid == 1 Then
MsgBox(64, "Cleware", "Number of Devices: " & $i_deviceid)
_ClewareResetDevice($h_dll, $ptr_cusbaccess, 1)$i_time = DllStructCreate("int")
[/autoit] [autoit][/autoit] [autoit]
$d_temperature = DllStructCreate("double")
DllStructSetData($i_time, 1, 0)
DllStructSetData($d_temperature, 1, 0)
$a_cwtemperature = DllCall($h_dll, "int", "_FCWGetTemperature@16", _
"ptr", $ptr_cusbaccess, _
"int", 1, _
"ptr", DllStructGetPtr($d_temperature), _
"ptr", DllStructGetPtr($i_time))Select
[/autoit] [autoit][/autoit] [autoit]
Case @error == 0
_ArrayDisplay($a_cwtemperature)
MsgBox(64, "Cleware", "Temperatur: " & $a_cwtemperature[1] & " °C.")
Case @error == 1
MsgBox(16, "Error", "Unable to use DLL.")
Case @error == 2
MsgBox(16, "Error", "Unknown return type.")
Case @error == 3
MsgBox(16, "Error", "Function not found in DLL.")
EndSelect
EndIf
EndFunc ;==>_ClewareGetTemperatureFunc main()
[/autoit] [autoit][/autoit] [autoit]
Local Const $S_APPTITLE = "Get USBTemp"
Local Const $S_APPVERSION = "1.0"
Local Const $S_DLLPATH = @ScriptDir & "\USBaccess.dll"
Local $a_msg = -1Local $h_maingui = GUICreate($S_APPTITLE & " v" & $S_APPVERSION, 320, 240, -1, -1)
[/autoit] [autoit][/autoit] [autoit]
Local $h_readtempbt = GUICtrlCreateButton("&Read Temperature", 10, 10, 120, 20)
Local $h_readversionbt = GUICtrlCreateButton("&DLL Version", 160, 10, 120, 20)Local $h_dll = DllOpen($S_DLLPATH)
[/autoit] [autoit][/autoit] [autoit]
If $h_dll == -1 Then
MsgBox(16, "Error", 'Unable to open "' & $S_DLLPATH & '".')
Exit (1)
EndIf
Local $ptr_cusbaccess = _ClewareInit($h_dll)GUISetState(@SW_SHOW, $h_maingui)
[/autoit]
While 1
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop 1
Case $a_msg[0] == $h_readtempbt
_ClewareGetTemperature($h_dll, $ptr_cusbaccess)
Case $a_msg[0] == $h_readversionbt
MsgBox(64, "Cleware", "DLL Version: " & _ClewareGetDLLVersion($h_dll))
EndSelect
WEnd
GUIDelete($h_maingui)
_ClewareUnInit($h_dll, $ptr_cusbaccess)
DllClose($h_dll)
Exit (0)
EndFunc ;==>main -
Mhh, Mist. Habe doch noch ein Problem. Kann zwar nun die Anzahl der Devices auslesen, nicht aber die Temperatur:
Spoiler anzeigen
[autoit];~ Including external files / Changing the operation of AutoIt functions/parameters.
[/autoit] [autoit][/autoit] [autoit]
;~ ----------------------------------------------------------------------------
#NoTrayIcon
#include <Array.au3>
#include <GUIConstants.au3>
Opt("GUICloseOnESC", 0)
Opt("MustDeclareVars", 1)
Opt("RunErrorsFatal", 0)
;~ -----------------------------------------------------------------------------
main()Func _ClewareGetDLLVersion($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $i_cwversion = DllCall($h_dll, "int", "_FCWGetDLLVersion@0")Return ($i_cwversion[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareGetDLLVersionFunc _ClewareInit($h_dll)
[/autoit] [autoit][/autoit] [autoit]
Local $ptr_cw = DllCall($h_dll, "ptr", "_FCWInitObject@0")
If IsArray($ptr_cw) == 0 Or $ptr_cw[0] == 0 Then
MsgBox(16, "Error", "Invalid address on FCWInitOject!")
Exit (1)
EndIfReturn ($ptr_cw[0])
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ClewareInitFunc _ClewareGetTemp($h_dll, $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
Local $a_cwdevices, $a_cwtemperature = -1
Local $i_time, $d_temperature = 0$a_cwdevices = DllCall($h_dll, "int", "_FCWOpenCleware@4", "ptr", $ptr_cusbaccess)
[/autoit] [autoit][/autoit] [autoit]
If $a_cwdevices[0] == 1 Then
$a_cwtemperature = DllCall($h_dll, "int", "_FCWGetTemperature@16", "ptr", $ptr_cusbaccess, "int", 1, "ptr", $d_temperature, "int", $i_time)
Select
Case @error == 0
_ArrayDisplay($a_cwtemperature)
;~ MsgBox(16, "Notification", "Temperatur: " & $a_cwtemperature[1] & " °C.")
Case @error == 1
MsgBox(16, "Error", "Unable to use DLL.")
Case @error == 2
MsgBox(16, "Error", "Unknown return type.")
Case @error == 3
MsgBox(16, "Error", "Function not found in DLL.")
EndSelect
EndIf
EndFunc ;==>_ClewareGetTempFunc OnAutoItExit()
[/autoit] [autoit][/autoit] [autoit]
GUIDelete($h_maingui)
DllClose($h_dll)
EndFunc ;==>OnAutoItExitFunc main()
[/autoit] [autoit][/autoit] [autoit]
Local Const $S_APPTITLE = "USB Temperature"
Local Const $S_APPVERSION = "1.0"
Local Const $S_DLLPATH = @ScriptDir & "\USBaccess.dll"
Local $a_msg = -1Global $h_maingui = GUICreate($S_APPTITLE & " v" & $S_APPVERSION, 640, 480, -1, -1)
[/autoit] [autoit][/autoit] [autoit]
Local $h_readtempbt = GUICtrlCreateButton("&Read Temperature", 10, 10, 120, 20)
Local $h_readversionbt = GUICtrlCreateButton("&DLL Version", 160, 10, 120, 20)Global $h_dll = DllOpen($S_DLLPATH)
[/autoit] [autoit][/autoit] [autoit]
If $h_dll == -1 Then
MsgBox(16, "Error", 'Unable to open "' & $S_DLLPATH & '".')
Exit (1)
EndIf
Local $ptr_cusbaccess = _ClewareInit($h_dll)GUISetState(@SW_SHOW, $h_maingui)
[/autoit]
While 1
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop 1
Case $a_msg[0] == $h_readtempbt
_ClewareGetTemp($h_dll, $ptr_cusbaccess)
Case $a_msg[0] == $h_readversionbt
MsgBox(64, "Cleware Version", _ClewareGetDLLVersion($h_dll))
EndSelect
WEnd
Exit (0)
EndFunc ;==>mainDie Funktion _FCWGetTemperature@16 verlangt als Übergabeparameter ein double, das gibt die Funktion DLLCall aber gar nicht her. Daher die Frage, wie lässt sich das lösen?
-
Geile Sache. Ok, dass mit den FCW-Funktionen hatte ich wohl überlesen. Aber wie bist Du denn darauf gekommen vor die Funktion einen "_" und danach "@" zu schreiben? Anfrage beim Hersteller, oder hab ich da auch was übersehen?
Auf jeden Fall: Vielen Dank. Echt geile Sache...

-
Echt gute Frage, mir fällt nur der Weg über die Transparenz ein, da man - so glaube ich zumindest - nicht auf die controls zugreifen kann, wenn man das programm komplett versteckt ausführt. Oder halt so:
Spoiler anzeigen
[autoit]Local $s_mainwintitle = "Unbenannt - Editor"
[/autoit] [autoit][/autoit] [autoit]
Local $s_savewintitle = "Speichern unter"Run("notepad.exe", "", @SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]
WinWait($s_mainwintitle, "")
WinSetState($s_mainwintitle, "", @SW_HIDE)
ControlSend($s_mainwintitle, "", 15, "Hallo! Dies ist Text in Notepad...", 1)
Send("^s", 0)
WinWait($s_savewintitle, "")
WinSetState($s_savewintitle, "", @SW_HIDE)
Send("Name_der_Datei.txt", 0)
Send("!s!db", 0)Exit(0)
[/autoit]Was aber so ziemlich aufs Gleiche hinauskommt...
-
Ja, stimmt. soweit gefixt. Hab mal eben alles unrelevante raus genommen. Das Problem bleibt. Er gibt immer aus, dass die Funktion nicht vorhanden ist. Bei der user32.dll von Windows klappt der Zugrif aber zum Beispiel. Funktioniert das Ganze den bei Dir?
Spoiler anzeigen
[autoit]#NoTrayIcon
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
#include <Constants.au3>
#include <GUIConstants.au3>
Opt("MustDeclareVars", 0)
main()
Func _ClewareGetTemp($s_dllpath)
Local $h_dll, $dllret = -1
$h_dll = DllOpen($s_dllpath)
If $h_dll == -1 Then
MsgBox(16, "Error", "Unable to open " & $s_dllpath)
EndIf$dllret = DllCall($h_dll, "int", "OpenCleware")
[/autoit] [autoit][/autoit] [autoit]
Select
Case @error == 0
MsgBox(16, "Notification", "Gefundene Geräte: " & $dllret[0])
Case @error == 1
MsgBox(16, "Error", "Unable to use " & $s_dllpath)
Case @error == 2
MsgBox(16, "Error", "Unknown return type.")
Case @error == 3
MsgBox(16, "Error", "Function not found in " & $s_dllpath)
EndSelectDllClose($h_dll)
[/autoit]
EndFunc
Func main()
Local Const $S_APPTITLE = "USB Temperature"
Local Const $S_APPVERSION = "1.0"
Local Const $S_DLLPATH = @ScriptDir & "\USBaccess.dll"
Local $h_maingui, $h_readtempbt, $a_msg = -1
$h_maingui = GUICreate($S_APPTITLE & " v" & $S_APPVERSION, 640, 480, -1, -1, $WS_BORDER + $WS_SYSMENU + $WS_VISIBLE)
$h_readtempbt = GUICtrlCreateButton("&Read Temperature", 10, 10, 120, 20)
While 1
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop
Case $a_msg[0] == $h_readtempbt
_ClewareGetTemp($S_DLLPATH)
EndSelect
WEnd
GUIDelete($h_maingui)
Exit(0)
EndFunc -
Mhh, ne. Egal was ich mache. Es kommt immer der Fehler, dass die Funktion nicht gefunden wurde...
Spoiler anzeigen
[autoit]#NoTrayIcon
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
#include <Constants.au3>
#include <GUIConstants.au3>
Opt("MustDeclareVars", 0)
main()
Func _ClewareGetTemp($s_dllpath)
Local $h_dll, $dllret
$h_dll = DllOpen($s_dllpath)
If $h_dll == -1 Then
MsgBox(16, "Error", "Unable to open " & $s_dllpath)
EndIf$dllret = DllCall($h_dll, "OpenCleware", "int")
[/autoit] [autoit][/autoit] [autoit]
If Not @error Then
MsgBox(0, "Debug", "Gefundene Geräte: " & $dllret[0])
EndIf;~ GetTemperature(int deviceNo, double *Temperature, int *timeID)
[/autoit]
$dllret = DllCall($h_dll, 'int', '58', 'int', 1)
Select
Case @error == 1
MsgBox(16, "Error", "Unable to use " & $s_dllpath)
Case @error == 2
MsgBox(16, "Error", "Unknown return type.")
Case @error == 3
MsgBox(16, "Error", "Function not found in " & $s_dllpath)
EndSelect
If IsArray($dllret) Then
MsgBox(0, "Debug", $dllret[0])
EndIf
DllClose($h_dll)
EndFunc
Func main()
Local Const $S_APPTITLE = "USB Temperature"
Local Const $S_APPVERSION = "1.0"
Local Const $S_DLLPATH = @ScriptDir & "\USBaccess.dll"
Local $a_harddisk, $i_maingui, $i_readtempbt, $a_msg
$i_maingui = GUICreate($S_APPTITLE & " v" & $S_APPVERSION, 640, 480, -1, -1, $WS_BORDER + $WS_SYSMENU + $WS_VISIBLE)
$i_readtempbt = GUICtrlCreateButton("&Read Temperature", 10, 10, 120, 20)
While 1
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop
Case $a_msg[0] == $i_readtempbt
_ClewareGetTemp($S_DLLPATH)
EndSelect
WEnd
GUIDelete($i_maingui)
Exit(0)
EndFunc -
Ja, da stand es doch schon (bei gtaspiders Post):
Spoiler anzeigen
[autoit]#include <GUIConstants.au3>
[/autoit] [autoit][/autoit] [autoit]$f_readvalue = 25.8
[/autoit] [autoit][/autoit] [autoit]$h_maingui = GUICreate("FB 0.00A for GW", 320, 40, -1, -1)
[/autoit] [autoit][/autoit] [autoit]
$h_progressbar = GUICtrlCreateProgress(10, 10, 300, 20, $PBS_SMOOTH )
GUICtrlSetData($h_progressbar, $f_readvalue)GUISetState(@SW_SHOW, $h_maingui)
[/autoit]
While 1
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop 1
EndSelect
WEnd
GUIDelete($h_maingui)
Exit(0) -
Hi,
irgendwie versteh ich nicht ganz was Du willst. 25,8% sollen 100% sein? Oder willst Du einfach nur 25,8% anzeigen lassen? Ich denke mal nicht, dass Du folgendes meinst:
[autoit]#include <GUIConstants.au3>
[/autoit][autoit][/autoit][autoit]
$h_maingui = GUICreate("FB 0.00A for GW", 320, 70, -1, -1)
$h_progressbar = GUICtrlCreateProgress(10, 10, 300, 20, $PBS_SMOOTH )
$h_fillbt = GUICtrlCreateButton("&Fill", 10, 40, 60, 20)
GUISetState(@SW_SHOW, $h_maingui)$f_readvalue = 25.8
[/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]
$a_msg = GUIGetMsg(1)Select
[/autoit]
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop 1
Case $a_msg[0] == $h_fillbt
GUICtrlSetData($h_progressbar, $f_readvalue)
EndSelect
WEnd
GUIDelete($h_maingui)
Exit(0) -
Hi,
ich weiß, die Frage mit dem Zugriff auf DLL-Funktionen kam schon öfter auf, aber vielleicht hilft mir das hier mal zur Klärung...
Ich will mit AutoIt die USBaccess.dll von Cleware (http://www.cleware.de/) nutzen, damit kann man z.B. die Temperatur von einem USB-Device von Cleware auslesen. Mit C/C++ klappt das Ganze auch einwandfrei, mit AutoIt komm ich da aber auf keinen Nenner. Die Funktionen sind alle in der API.pdf (im Anhang) beschrieben und ich möchte jetzt vorherst nur eine Rückgabe, ob die Funktion aufgerufen werden kann mit AutoIt. Dazu folgender Code:
Spoiler anzeigen
[autoit]#NoTrayIcon
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
#include <Constants.au3>
#include <GUIConstants.au3>
Opt("MustDeclareVars", 0)
main()Func _ClewareGetTemp($s_dllpath, $s_function, $s_returnval)
[/autoit] [autoit][/autoit] [autoit]
Local $h_dll$h_dll = DllOpen($s_dllpath)
[/autoit] [autoit][/autoit] [autoit]
If $h_dll == -1 Then
MsgBox(16, "Error", "Unable to open " & $s_dllpath)
EndIfDllCall($h_dll, $s_returnval, $s_function)
[/autoit] [autoit][/autoit] [autoit]
Select
Case @error == 1
MsgBox(16, "Error", "Unable to use " & $s_dllpath)
Case @error == 2
MsgBox(16, "Error", "Unknown return type of " & $s_function)
Case @error == 3
MsgBox(16, "Error", "Function " & $s_function & " not found in " & $s_dllpath)
EndSelectDllClose($h_dll)
[/autoit] [autoit][/autoit] [autoit]
EndFuncFunc main()
[/autoit] [autoit][/autoit] [autoit]
Local Const $S_APPTITLE = "USB Temperature"
Local Const $S_APPVERSION = "1.0"
Local Const $S_DLLPATH = "USBaccess.dll"
Local $a_harddisk, $i_maingui, $i_readtempbt, $a_msg$i_maingui = GUICreate($S_APPTITLE & " v" & $S_APPVERSION, 640, 480, -1, -1, $WS_BORDER + $WS_SYSMENU + $WS_VISIBLE)
[/autoit] [autoit][/autoit] [autoit]
$i_readtempbt = GUICtrlCreateButton("&Read Temperature", 10, 10, 120, 20)While 1
[/autoit]
$a_msg = GUIGetMsg(1)
Select
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop
Case $a_msg[0] == $i_readtempbt
_ClewareGetTemp($S_DLLPATH, "CUSBaccess CWusb", "none")
EndSelect
WEnd
GUIDelete($i_maingui)
Exit(0)
EndFuncNormalerweise müsste ich doch jetzt was anderes zurückbekommen als @error... Habs auch mit anderen Funktionen getestet. Liegt es daran, dass die DLL extra für so eine Nutzung gebaut werden muss (bin ned so der experte im umgang mit dlls...) eigentlich müsste eine Nutzung der Funktionen doch möglich sein, wenn sie als public deklariert sind...
Achso, was ich noch gesehen hab ist, dass sie Beispiele in VB dabei haben... Das wäre ansonsten natürlich eine Alternative diese in AutoIt zu übersetzen, allerdings nutzen sie dafür ActiveX-Steuerelemente... (Wie nutzt man denn die?)
Naja, bin mal gespannt auf Antworten.

bernd670: Spoiler gesetzt!
-
Jupp, Hilfe sollte Dir bei solchen Fragen eigentlich immer helfen können. Nur zur Erklärung:
Du musst erst das Tab-control an sich erstellen, dann den Reiter und danach die controls, die du in diesem Reiter hast. Am Ende schließt du die Tab-Definitionen mit einem leeren Reiter:Beispiel:
[autoit]#include <GUIConstants.au3>
[/autoit][autoit][/autoit][autoit]
$h_maingui =GUICreate("FB 0.00A for GW", 600, 500, -1, -1)
GUICtrlCreateTab(10, 10, 580, 480)
GUICtrlCreateTabitem("ReadMe")
$h_okbt = GUICtrlCreateButton("&Start", 500, 450, 60, -1)
GUICtrlCreateTabitem("")GUISetState(@SW_SHOW, $h_maingui)
[/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]
$a_msg = GUIGetMsg(1)Select
[/autoit]
Case $a_msg[0] == $GUI_EVENT_CLOSE
ExitLoop 1
Case $a_msg[0] == $h_okbt
MsgBox(64, "Test", "You clicked on Start!")
EndSelect
WEnd
GUIDelete($h_maingui)
Exit(0)Zu Deiner Frage mit dem include: Ein include ist - einfach gesagt - einfach nur eine Anweisung für den Compiler, die angegebene Datei "mitzunehmen". Es ist also nichts weiter als eine textuelle Ersetzung. Du könntest genausogut den Inhalt der GUIConstants.au3 in Dein Skript kopieren - macht aber keinen Sinn.
-
Zitat
Original von th.meger
das wurde entfernt.Hab ich was verpasst? Wurde ersetzt durch "Compile using AutoIt3Wrapper"
Falls du den Eintrag nicht hast setze folgende Registryschlüssel:
Code"HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile using AutoIt3Wrapper" "HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile using AutoIt3Wrapper\Command"In letzterem setzt du den Defaulteintrag vom Typ REG_SZ auf:
Oder halt dem Verzeichnis, wo deine AutoIt3Wrapper.exe liegt. -
@CallMeN00b68
[autoit]
Hilfe richtig lesen:FileRead
[/autoit]:
CodeReturn Value Success: Returns the binary/string read. Special: Sets @error to -1 if end-of-file is reached. Failure: Sets @error to 1 if file not opened in read mode or other error. Sets @error to 2 if count not defined for file open in raw read mode.Und wenn deine Datei Carriage Returns und Linefeeds enthält, dann liest er das natürlich mit ein... Kommt halt ganz auf das an, was du vorhast...
-
Alter, Falter...
Hab Dein Skript mal ein "wenig" verkleinert. (Wenn ich nicht total blind war, dann wird achtmal das Gleiche gemacht (nur mit anderer Dateiendung und Debugmeldung).
Hab mir das Skript nicht näher angeschaut, aber Du kannst Dir da noch vieles vieles einfacher machen. Du prüfst z.B. zum Ende hin nochmal auf Dateien, auf die Du zu Anfang geprüft hast (Wo sollen die denn hin sein? Dein Skript löscht doch nichts.)
Lass Dir mal den ausgelesenen Timestamp aus der INI und den von Dir erzeugten Timestamp in ner MSGBox ausgeben und überprüfe deine Abfragen vor Fehlermeldungen, dann wird das was.

Spoiler anzeigen
[autoit]#NoTrayIcon
[/autoit] [autoit][/autoit] [autoit]
#include <Date.au3>
#include <File.au3>Opt("MustDeclareVars", 1)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Opt("RunErrorsFatal", 0)Func CheckFile($s_filename, $i_mode = 2)
[/autoit] [autoit][/autoit] [autoit]
Local $h_file = -1$h_file = FileOpen($s_filename, $i_mode)
[/autoit] [autoit][/autoit] [autoit]
If $h_file == -1 Then
MsgBox(16, "Error", "Unable to open file.")
Exit (1)
EndIfReturn ($h_file)
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>CheckFileFunc FailMailExists($s_filename, $s_mandant)
[/autoit] [autoit][/autoit] [autoit]
Local $h_file = -1$h_file = CheckFile($s_filename, 2)
[/autoit] [autoit][/autoit] [autoit]
FileWrite($h_file, "To: [email='Helpdesk@verkehrsbuero.at'][/email]" & @CRLF)
FileWrite($h_file, "Subject: " & @MDAY & "." & @MON & "." & @YEAR & " ACHTUNG !! Der Jack (Mandant: " & $s_mandant & ") hat Datenüberleitungs Probleme!" & @CRLF & @CRLF)
FileWrite($h_file, "Diese Files sind auf dem CRS nicht vorhanden :" & @CRLF & @CRLF)Return ($h_file)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>FailMailExistsLocal Const $S_CONFIGFILE = @ScriptDir & "\Export.ini"
[/autoit] [autoit][/autoit] [autoit]
Local Const $S_EMPTYVAL = "Keine Pfad konfiguriert"
Local Const $S_OKFILE = @ScriptDir & "\OK_MAIL.txt"
Local Const $S_FAILFILE = @ScriptDir & "\Fail_MAIL.txt"
Local Const $S_OKSMSFILE = @ScriptDir & "\OK_SMS.TXT"
Local Const $S_FAILSMSFILE = @ScriptDir & "\Fail_SMS.TXT"
Local Const $s_smsrecipient = "*"
Local Const $A_FILEEXT[8] = ["*.A", "*.J", "\*.K", "\*.B", "\*.S", "\*.U", "*.V", "\*.M"]Local $s_mandant = IniRead($S_CONFIGFILE, "MANDANT", "MAN", $S_EMPTYVAL)
[/autoit] [autoit][/autoit] [autoit]
Local $A_DESCRIPTION[8] = ["A" & $s_mandant & " File (Mitarbeiter Export)", "J" & $s_mandant & " File (Journal Export)", _
"K" & $s_mandant & " File (Kunden Export)", "B" & $s_mandant & " File (SAP Export)", _
"S" & $s_mandant & " File (SAP Export)", "U" & $s_mandant & " File (SAP Export)", _
"V" & $s_mandant & " File (Buchungs Gesamt Preis Liste Export)", "M" & $s_mandant & " File (MIS Export)"]Local $s_crspath = IniRead($S_CONFIGFILE, "PFADE", "CRS", $S_EMPTYVAL)
[/autoit] [autoit][/autoit] [autoit]
Local $s_crsmpath = IniRead($S_CONFIGFILE, "PFADE", "CRSM", $S_EMPTYVAL)
Local $s_crswpath = IniRead($S_CONFIGFILE, "PFADE", "CRSW", $S_EMPTYVAL)
Local $s_rootpath = IniRead($S_CONFIGFILE, "PFADE", "root", $S_EMPTYVAL)
Local $s_timeend = IniRead($s_rootpath & "\log\time.stamp", "TIME", "ende", "NotFound")
Local $s_mailsender = IniRead($S_CONFIGFILE, "MAIL", "FROM", "Jack@verkehr*.lan")
Local $s_mailserver = IniRead($S_CONFIGFILE, "MAIL", "SRV", "172.30.241.40")Local $s_currentfile, $s_filetime = ""
[/autoit] [autoit][/autoit] [autoit]
Local $a_filetime, $h_file = -1For $i = 0 To $A_FILEEXT[0] Step 1
[/autoit] [autoit][/autoit] [autoit]
$s_currentfile = $s_crswpath & "\" & $A_FILEEXT[$i] & $s_mandantIf FileExists($s_currentfile) == 1 Then
[/autoit] [autoit][/autoit] [autoit]
$a_filetime = FileGetTime($s_currentfile, 1, 0)
If _DateTimeFormat(_DateAdd('d', -1, $a_filetime[0] & "/" & $a_filetime[1] & "/" & $a_filetime[2]), 2) = $s_timeend Then
If FileExists($S_OKFILE) == 1 Then
$h_file = CheckFile($S_OKFILE, 1)
FileWriteLine($h_file, "To: [email='Helpdesk@verkehrsbuero.at'][/email]" & @CRLF)
FileWriteLine($h_file, "Subject: " & @MDAY & "." & @MON & "." & @YEAR & " Der Jack (Mandant: " & $s_mandant & ") hat die Daten auf den CRS übergeleitet!" & @CRLF & @CRLF)
FileWriteLine($h_file, "Die Files sind auf dem CRS vorhanden:" & @CRLF & @CRLF)
Else
$h_file = CheckFile($S_OKFILE, 2)
EndIf
FileWriteLine($h_file, "Das " & $A_DESCRIPTION[$i] & " ist vorhanden" & @CRLF & @CRLF)
FileClose($h_file)
Else
If FileExists($S_FAILFILE) == 1 Then
$h_file = FailMailExists($S_FAILFILE, $s_mandant)
Else
$h_file = CheckFile($S_FAILFILE, 2)
EndIf
FileWriteLine($h_file, "Das " & $A_DESCRIPTION[$i] & " ist mit falschen Datum vorhanden" & @CRLF)
FileWriteLine($h_file, "Bitte die Überleitung auf der CTWS04 Überprüfen" & @CRLF)
FileClose($h_file)
EndIf
Else
If FileExists($S_FAILFILE) == 1 Then
$h_file = CheckFile($S_FAILFILE, 1)
Else
$h_file = FailMailExists($S_FAILFILE, $s_mandant)
EndIf
FileWriteLine($h_file, "Das " & $A_DESCRIPTION[$i] & " ist nicht vorhanden" & @CRLF)
FileClose($h_file)
EndIf
NextIf FileExists($S_FAILFILE) == 1 Then
[/autoit] [autoit][/autoit] [autoit]
$h_file = CheckFile($S_FAILSMSFILE, 1)
FileWrite($h_file, " Der Jack-Mandant: " & $s_mandant & " hat Datenueberleitungsprobleme! Bitte um Kontrolle!")
FileClose($h_file)
RunWait(@ScriptDir & "\VMAILER.EXE " & $S_FAILSMSFILE & " " & $s_mailserver & " " & $s_smsrecipient & " " & $s_mailsender)
FileDelete($S_FAILSMSFILE)
Else
$h_file = CheckFile($S_OKSMSFILE, 1)
FileWrite($h_file, " Der Jack-Mandant: " & $s_mandant & " hat alle Daten uebergeleitet")
FileClose($h_file)
RunWait(@ScriptDir & "\VMAILER.EXE " & $S_OKSMSFILE & " " & $s_mailserver & " [email='06646258027@SMSGATEWAY.verkehrsbuero.lan'][/email] " & $s_mailsender)
FileDelete($S_OKSMSFILE)
EndIfIf FileExists($S_FAILSMSFILE) Then
[/autoit] [autoit][/autoit] [autoit]
RunWait(@ScriptDir & "\VMAILER.EXE " & $S_FAILFILE & " " & $s_mailserver & " " & $s_smsrecipient & " " & $s_mailsender)
Else
RunWait(@ScriptDir & "\VMAILER.EXE " & $S_OKFILE & " " & $s_mailserver & " " & $s_smsrecipient & " " & $s_mailsender)
EndIfIf FileExists($S_OKFILE) == 1 Then
[/autoit] [autoit][/autoit] [autoit]
FileDelete($S_OKFILE)
EndIfIf FileExists($S_FAILFILE) == 1 Then
[/autoit] [autoit][/autoit] [autoit]
FileDelete($S_FAILFILE)
EndIfRun(@ScriptDir & '\Speicher_Warnung.exe', @ScriptDir)
[/autoit] [autoit][/autoit] [autoit]Exit (0)
[/autoit]Edit BugFix: Spoiler eingefügt
-
Ich würde Dir ffmpeg empfehlen: http://ffmpeg.mplayerhq.hu/.
Ist unter Linux quasi der Standard schlechthin (im verbund mit transcode). ffmpeg gibt es auch bereits compiliert als Windows binary unter: http://ffdshow.faireal.net/mirror/ffmpeg/.Das Projekt wird laufend aktualisiert und ca. halbmonatlich kommt ein neuer Release raus. Wenn du dir die Projectseite (erster Link) anschaust findest Du auch die entsprechende Dokumentation dazu.