Danke für deine Erläuterung. Dann habe ich das missverstanden.
Beiträge von PixelStorm
-
-
Hallo BugFix,
ich weiss nicht ob ich deinen Post richtig verstanden habe, aber bei mir funktioniert die Ausgabe von Array Variablen auch. Anbei mal der Beispielcode.
Falls du etwas anderes meintest, würde ich mich über eine Erkärung freuen.
CodeLocal $v = [1, 2, 3] ; An Array For $x= 0 to UBound($v)-1 ConsoleWrite("$vVar = " & $v[$x] & @CRLF) Next ConsoleWrite('Let''s go!' & @LF) For $i = 1 To 10 Step +1 ConsoleWrite($i & @LF) Sleep(500) Next ConsoleWrite('Done!' & @LF)
Die Konsolenausgabe in VSCode sieht folgendermassen aus:
+>08:40:29 Starting AutoIt3Wrapper (19.1127.1402.0} from:Code.exe (0.0.0.0) Keyboard:00000407 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0407)
>Running AU3Check (3.3.14.5) from:c:\Program Files (x86)\AutoIt3 input:c:\Program Files (x86)\AutoIt3\Projects\Visteon\MFA2 Version Compare\ConsoleTest.au3
+>08:40:29 AU3Check ended.rc:0
>Running:(3.3.14.5):c:\Program Files (x86)\AutoIt3\autoit3.exe "c:\Program Files (x86)\AutoIt3\Projects\Visteon\MFA2 Version Compare\ConsoleTest.au3" /errorstdout
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop.
$v = 1
$v = 2
$v = 3
Let's go!
1
2
3
4
5
6
7
8
9
10
Done!
+>08:40:34 AutoIt3.exe ended.rc:0
+>08:40:34 AutoIt3Wrapper Finished.
Process exited with code 0 -
-
Hallo,
ich habe gestern meine Entwicklungsumgebung von ISN AutoIt Studio auf Visual Studio Code umgestellt weil seit Version 1.09 des ISN AutoIt Studios bei mir das FormStudio nicht mehr funktioniert.
Dazu muss ich sagen das ich die ISN Entwicklungsumgebung seit ca. 4 jahren bei uns in der Firma genutzt habe, aber seit Version 1.09 löscht unser Virentool (McAfee) Dateien aus dem ISN bzw. steckt sie in Quarantäne so das ich FormStudio nicht mehr nutzen kann.
Deswegen habe ich gestern mal auf Visual Studio Code umgestellt und muss sagen das es wirklich gut funktioniert. Mann muss zwar wieder Koda als GUI Design Tool benutzen, aber das geht auch sehr gut.
Hat schon jemand anderes mit Visual Studio Code & AutoIt Erfahrung sammeln können? Würde mich interessieren wie es euch gefällt. -
Vielen Dank an alle, es hat super funktioniert. Ist zwar etwas umständlich, immer wieder alle Controls neu an zu passen (muss ich ja für alles ein Handle vergeben) aber das passt schon. GuiSetResizing geht leider nicht, weil sonst Linien in der gui nicht nur Verlängert, sondern auch in die breite gezogen werden.
Allerdings bin ich auf noch ein weiteres Problem gestoßen. da es bestimmt ähnlich leicht gelöst werden kann und zu dem gleichen Projekt gehört, schreibe ich das hier mit rein.
Ich muss von einem Bild (noch nicht in eine GUI eingebunden) die Breite und Höhe bestimmen. Das habe ich mit gdiPlus versucht, aber leider schaffe ich es nicht das Bild mittels _GDIPlus_ImageLoadFromFile zu laden. Ich bekomme immer 0 zurück.
AutoIt#include <GDIPlus.au3> #include <array.au3> Global $img=@ScriptDir & "\HMB.bmp" _ArrayDisplay(_GDIPlus_ImageGetDimension(_GDIPlus_ImageLoadFromFile($img))) MsgBox(0, "", _GDIPlus_ImageLoadFromFile($img)) Exit
Ich habe echt keine Ahnung, wo der Fehler liegt. Gibt es evtl. auch eine andere Möglichkeit?
Hallo Mistil,
du hast vergessen die GDI+ Library zu initialisieren
AutoIt
Alles anzeigen#include <GDIPlus.au3> #include <array.au3> ; Initialize GDI+ library _GDIPlus_Startup() Global $img = @MyDocumentsDir & "\HMB.bmp" _ArrayDisplay(_GDIPlus_ImageGetDimension(_GDIPlus_ImageLoadFromFile($img))) MsgBox(0, "", _GDIPlus_ImageLoadFromFile($img)) ; Shut down GDI+ library _GDIPlus_Shutdown() Exit
-
Hi Andy,
anbei mal mein AutoIt Code. Für die Funktionen trxPS und trxEON_PS gibt es jeweils eine Get- und eine Set- Variante. Ich habe dir mal von beiden die Set-Variante gepostet.
Aber wie bereits gesagt, die Funktionen trxPS und trxEON_PS funktionieren.
Danke nochmals für deine MüheGruß, PixelStorm
[autoit]
[/autoit][autoit][/autoit][autoit]
#Region TRX011 Constants and Variables ----------------------------------------------------------------------------------------------
Global Const $TRX01 = 1
Global Const $TRX02 = 2
Global $PS_String = ""
Global $PSCode = DllStructCreate("BYTE[9]")
Global $pPSCode = DllStructGetPtr($PSCode)
Global $EONPS_String = ""
Global $EONPSCode = DllStructCreate("BYTE[9]")
Global $pEONPSCode = DllStructGetPtr($EONPSCode)
Global $RDSFile = @WorkingDir & "\Stream.txt_hex"
#EndRegion TRX011 Constants and Variables -------------------------------------------------------------------------------------------#Region Function Test() -----------------------------------------------------------------------------------------------------------------
[/autoit][autoit][/autoit][autoit]
Func Test()
Set_TX_PSCode($TRX01, "TRX-01") ; ($Unit, $PSCodeValue = String with a maximum length of 8 characters)
Set_TX_EONPSCode($TRX01, 0xAAAA, "TRX-02") ; ($Unit, $PI_CODE = 0x0000 to 0xFFFF, $EONPSCodeValue = String with a maximum length of 8 characters)
TX_LoadRDS($TRX02, $RDSFile)
EndFunc
#EndRegion Function Test() --------------------------------------------------------------------------------------------------------------#Region Function Set_TX_PSCode() --------------------------------------------------------------------------------------------------------
[/autoit][autoit][/autoit][autoit]
#cs #####################################################################################################################################
# Function: Set_TX_PSCode($Unit, $PSCodeValue) #
#ce #####################################################################################################################################
Func Set_TX_PSCode($Unit, $PSCodeValue)
Local $i, $x, $PSStringArray = 0
If StringLen($PSCodeValue) > 8 Then
MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONWARNING), "Error setting the PS-String!!!", "The given PS-String has " & StringLen($PSCodeValue) & " characters." & @CRLF _
& "The string will be truncated to 8 characters !!!")
$PSCodeValue = StringTrimRight($PSCodeValue, StringLen($PSCodeValue) -
EndIf
$PSStringArray = StringToASCIIArray($PSCodeValue)
DllStructSetData ($PSCode, 1, UBound($PSStringArray), 1)
For $i = 2 To UBound($PSStringArray) + 1
DllStructSetData ($PSCode, 1, $PSStringArray[$x], $i)
$x += 1
Next
$trxString = DllCallAddress("INT", $trxPS, "BYTE", $Unit, "BOOLEAN", True, "PTR", $pPSCode)
EndFunc
#EndRegion Function Set_TX_PSCode() -----------------------------------------------------------------------------------------------------#Region Function Set_TX_EONPSCode() -----------------------------------------------------------------------------------------------------
[/autoit][autoit][/autoit][autoit][/autoit]
#cs #####################################################################################################################################
# Function: Set_TX_EONPSCode($Unit, $PI_CODE, $EONPSCodeValue) #
#ce #####################################################################################################################################
Func Set_TX_EONPSCode($Unit, $PI_CODE, $EONPSCodeValue)
Local $i, $x, $EONPSStringArray = 0
If StringLen($EONPSCodeValue) > 8 Then
MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONWARNING), "Error setting the PS-String!!!", "The given EONPS-String has " & StringLen($EONPSCodeValue) & " characters." & @CRLF _
& "The string will be truncated to 8 characters !!!")
$EONPSCodeValue = StringTrimRight($EONPSCodeValue, StringLen($EONPSCodeValue) -
EndIf
$EONPSStringArray = StringToASCIIArray($EONPSCodeValue)
DllStructSetData ($EONPSCode, 1, UBound($EONPSStringArray), 1)
For $i = 2 To UBound($EONPSStringArray) + 1
DllStructSetData ($EONPSCode, 1, $EONPSStringArray[$x], $i)
$x += 1
Next
$trxString = DllCallAddress("INT", $trxEON_PS, "BYTE", $Unit, "BOOLEAN", True, "INT", $PI_CODE, "PTR", $pEONPSCode)
EndFunc
#EndRegion Function Set_TX_EONPSCode() --------------------------------------------------------------------------------------------------
#Region Function TX_LoadRDS() -----------------------------------------------------------------------------------------------------------
#cs #####################################################################################################################################
# Function: TX_LoadRDS($Unit, $FileName) #
#ce #####################################################################################################################################
Func TX_LoadRDS($Unit, $FileName)
;DllCallAddress ( "return type", address [, type1, param1 [, type n, param n]] )
$trxString = DllCallAddress("INT", $trxLoadRDS, "BYTE", $Unit, "STR", $FileName)
; Ich habe auch diese Variante probiert:
;$trxString = DllCallAddress("INT", $trxLoadRDS, "BYTE", $Unit, "STR*", $FileName)
;Ebenfalls ohne Erfolg
EndFunc
#EndRegion Function TX_LoadRDS() -------------------------------------------------------------------------------------------------------- -
Nachtrag zu Post #11:
Ich habe jetzt mal die Datei direkt in das Scriptverzeichnis gelegt und versucht von dort zu laden, leider auch ohne Erfolg.
Jetzt bin ich dann wirklich am Ende mit meinen Möglichkeiten.Gruß, PixelStorm
-
Hallo Andy,
wie schon in Post #7 geschrieben habe ich eine Referenzdatei, die auch einwandfrei eingelesen wird.
Die dll liegt im Scriptverzeichnis, warum fragst du? Die wird ja geladen und die anderen Funktionen gehen ja auch.
Das einzige was ich noch ausprobieren kann ist, die Datei ins Scriptverzeichnis zu legen und versuchen sie ohne Dateipfad zu laden.
Kann ich aber erst am Montag machen. Ich melde mich nochmals mit dem Ergebnis.
Schönen Sonntag noch.Gruß, PixelStorm
-
Hallo Andy,
wie bereits geschrieben, funktionieren alle anderen Funktionen. Habe das hier gerade am laufen und meinem Chef vorgeführt. Nur diese eine Funktion bekomme ich nicht gebacken.
Und gerade diese würde ich jetzt dringend brauchenGruß, PixelStorm
-
Hallo Andy,
vielen Dank erstmal für deine Antwort.
was bedeutet das "hex"?
Um es ein wenig transparenter für dich zu machen will ich dir kurz erklären worum es geht.
Ich habe hier eine Hardware die man mit Hilfe einer dazugehörigen dll programmtechnisch steuern kann.
In diesem Fall geht es darum das man verschiedene Setups in einer Datei speichern kann, mit der Endung ".txt_hex".
Diese Datei gibt es und wird auch von der Hardware korrekt eingelesen, wenn ich es manuell mache. Ich will es aber natürlich per AutoIt Script mit der dazugehörigen Funktion aus der dll machen.Was generell immer sinnvoll ist, ist der komplette Sourcecode der Funktion, nicht nur der Header!
Ich habe nur diesen Header. Die eigentliche Funktion befindet sich in der dll. Somit habe ich auch keinen Sourcecode der Funktion.Deine Lösungsvorschläge habe ich alle ausprobiert, leider ohne Erfolg. Mir ist einfach nicht klar was an den Übergabeparametern für diese Funktion anders ist als für alle anderen Funktionen in der dll.
Diese habe ich ja mit Hilfe von BugFix zum laufen bekommen (und sie funktionieren eigentlich alle nach dem gleichen Schema. Nur diese eine Funktion verweigert sich mir
Ich werde mal den kompletten Inhalt der Datei, die mir mit der dll geliefert wurde (trxRemoteIntf.pas) hier einfügen.Gruß, PixelStorm
Code
Alles anzeigenCONST // Result codes: trxCommOK = 0; trxCommNACK = 1; trxCommOutOfRange = 2; trxCommNoFile = 3; TYPE // parameter type to pass string data trxString = String[255]; // active units are returned by the initialize function // check for non zero entries // the number of the non-zero entries indicate the numbers // of the TRX011 units present on the system. // These numbers should be used to target a specific unit in // all functions given in this interface. // The content of the entry is the Windows handle of the TRX011 unit TtrxUnits= Array[0..255] of Integer; Procedure trxInitialize( Var NumberOfTRXunits : Byte; Var AvailableTRXunits : TtrxUnits); stdcall; external 'trxRemote.dll'; // this function should be called first by the remote control program // to find all active TRX011 units. Function trxIdentify( UnitNr : Byte) : Byte; stdcall; external 'trxRemote.dll'; // this function activates the Identification function // of a TRX011 unit for visual recognition // All functions sdescribed below need a UnitNr entry to identify the target device. // The SetValue paramater detemines whether a value should be witten to or read from the target device. // When SetValue is set to TRUE, the value will be written to the target device, otherwise the value // will be read from the target device. // All calls should be acknowledged by the target device; if not the function will return false. Function trxAttenuation( UnitNr : Byte; SetValue : Boolean; Var Value : Byte) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the attenuator of the unit identified by UnitNr. // Value should be a value between 0 and 127, indicating the // attenuation in 0.5 dB steps Function trxFrequency( UnitNr : Byte; SetValue : Boolean; Var Value : Integer) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the frequency of the transmitter of the unit identified by UnitNr. // Value should be a value between 87500 and 108000 kHz Function trxPI( UnitNr : Byte; SetValue : Boolean; Var Value : Integer) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the PI code of the transmitter of the unit identified by UnitNr. // Value may be any value between 0x0000 and 0xFFFF. Function trxPS( UnitNr : Byte; SetValue : Boolean; Var Value : trxString) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the main Program service name of the transmitter of the unit identified by UnitNr. // Value should be a string with a maximum length of 8 characters Function trxTA( UnitNr : Byte; SetValue : Boolean; Var Value : Boolean) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the TA flag of the transmitter of the unit identified by UnitNr. // The aTA flag is activated when value is set to TRUE, otherwise the flag is deactivated Function trxTP( UnitNr : Byte; SetValue : Boolean; Var Value : Boolean) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the TP flag of the transmitter of the unit identified by UnitNr. // The aTP flag is activated when value is set to TRUE, otherwise the flag is deactivated Function trxEON_TA( UnitNr : Byte; SetValue : Boolean; PIcode : Integer; Var TA : Boolean) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the TA flag of an EON entry specified by PI code of the transmitter of the unit identified by UnitNr. // The PI code should have any value between 0x0000 and 0xFFFF. // It's the programmers responsability whether the target PI code is present in the EON list of the target transmitter. Function trxEON_TP( UnitNr : Byte; SetValue : Boolean; PIcode : Integer; Var TP : Boolean) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the TP flag of an EON entry specified by PI code of the transmitter of the unit identified by UnitNr. // The PI code should have any value between 0x0000 and 0xFFFF. // It's the programmers responsability whether the target PI code is present in the EON list of the target transmitter. Function trxEON_PS( UnitNr : Byte; SetValue : Boolean; PIcode : Integer; Var Value : trxString) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the TP flag of an EON entry specified by PI code of the transmitter of the unit identified by UnitNr. // The PI code should have any value between 0x0000 and 0xFFFF. // It's the programmers responsability whether the target PI code is present in the EON list of the target transmitter. Function trxLoadRDS( UnitNr : Byte; Filename : trxString) : Byte; stdcall;external 'trxRemote.dll'; // This function clears the entire RDS data set and reloads it with data from the given file. // The file must be of type .txt_hex Function trxEAS( UnitNr : Byte; SetValue : Boolean; Var Value : Boolean) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the EAS Alarm flag of the transmitter of the unit identified by UnitNr. // The aEAS Alarm flag is activated when value is set to TRUE, otherwise the flag is deactivated Function trxMode( UnitNr : Byte; SetValue : Boolean; Var Value : Byte) : Byte; stdcall; external 'trxRemote.dll'; // Set or Get the TRX011 operation mode of the unit identified by UnitNr. // The following values can be entered or are returned: // 0 - Standby // 1 - RX mode // 2 - TX mode IMPLEMENTATION
-
Hallo Bugfix,
ich wende mich mal direkt an dich weil ich noch ein einziges Problem mit dieser DLL habe.
Bis auf eine Funktion habe ich alles zum laufen bekommen, aber diese eine Funktion treibt mich gerade in den Wahnsinn.CodeDas ist ein Ausschnitt aus einer Datei, die mir mit der dll geliefert wurde (trxRemoteIntf.pas) Function trxLoadRDS( UnitNr : Byte; Filename : trxString) : Byte; stdcall;external 'trxRemote.dll'; // This function clears the entire RDS data set and reloads it with data from the given file. // The file must be of type .txt_hex
Und hier ist mein dazugehöriger AutoIt Code
[autoit]
[/autoit]
Func TX_LoadRDS($Unit, $FileName)
Global $RDS_String = ""
Local $i, $x, $RDSStringArray = 0
$RDSStringArray = StringToASCIIArray($FileName)
Global $RDSFile = DllStructCreate("BYTE[" & UBound($RDSStringArray) & "]")
Global $pRDSFile = DllStructGetPtr($RDSFile)
DllStructSetData ($RDSFile, 1, UBound($RDSStringArray), 1)
For $i = 1 To UBound($RDSStringArray)
DllStructSetData ($RDSFile, 1, $RDSStringArray[$x], $i)
$x += 1
Next
$trxString = DllCallAddress("INT", $trxLoadRDS, "BYTE", $Unit, "PTR", $pRDSFile)
EndFuncDas Problem: Das File wird nicht geladen sondern AutoIt beendet sich mit: AutoIT3.exe ended.rc:-1073741819
Ich habe verschiedenes probiert, bekomme es aber einfach nicht hin. Vielleicht hättest du, oder selbstverständlich auch jeder andere, eine Lösung dafür.
Vielen Dank im Voraus für deine (eure) HilfeGruß, PixelStorm
-
Hallo BugFix,
ich kann nur sagen - Danke, Danke, Danke !!!!
Es hat sofort funktioniert. Das war ein tolles Weihnachtsgeschenk.
In diesem Sinne wünsche ich dir ein ebensolches und einen guten Rutsch ins neue Jahr.
Das hat mir wirklich sehr geholfen. Nochmals Danke.Gruß, PixelStorm
-
Hallo,
vielleicht könnte mir bitte jemand helfen um Funktionen aus einer dll, die in Delphi geschrieben wurde, aufzurufen.
Ich bin schon am verzweifeln warum das nicht klappt. Mit anderen dll's (z.B. System dll's) klappt es ohne Probleme.
Da ich das für ein Projekt in meiner Arbeit brauche wäre ich für Hilfe sehr dankbar.
Die dll kann ich öffnen und es ist mir auch möglich alle Funktionen (14) zu erreichen.Allerdings crashed AutoIt mit der Meldung: "AutoIT3.exe ended.rc:-1073741819" wenn ich die Ininitialisierungs Funktion (Procedure trxInitialize) der dll aufrufe.
Die dll kann ich aus Copyrightgründen nicht mitgeben (kostet 750€)
Vielleicht kann mir jemand sagen mit welchem Parametertyp ich diese dll-Funktion aufrufen muss.
Ich versuche es schon seit zwei Tagen und steh jetzt total auf dem Schlauch.
Vielen Dank im Voraus für eure Hilfe.Gruß, PixelStorm
Code
Alles anzeigenDas ist ein Ausschnitt aus einer Datei, die mir mit der dll geliefert wurde (trxRemoteIntf.pas) CONST // Result codes: trxCommOK = 0; trxCommNACK = 1; trxCommOutOfRange = 2; trxCommNoFile = 3; TYPE // parameter type to pass string data trxString = String[255]; // active units are returned by the initialize function // check for non zero entries // the number of the non-zero entries indicate the numbers // of the TRX011 units present on the system. // These numbers should be used to target a specific unit in // all functions given in this interface. // The content of the entry is the Windows handle of the TRX011 unit TtrxUnits= Array[0..255] of Integer; Procedure trxInitialize( Var NumberOfTRXunits : Byte; Var AvailableTRXunits : TtrxUnits); stdcall; external 'trxRemote.dll'; // this function should be called first by the remote control program // to find all active TRX011 units.
Hier einmal der AutoIt Code den ich benutze:
[autoit]#include <APIErrors.au3>
[/autoit][autoit][/autoit][autoit]
#include <Array.au3>
#include <WinAPI.au3>
#include <WinAPIReg.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>Global Const $trxCommOK = 0
[/autoit][autoit][/autoit][autoit]
Global Const $trxCommNACK = 1
Global Const $trxCommOutOfRange = 2
Global Const $trxCommNoFile = 3
Global $trxString = ""
Global $NumberOfTRXunits = 0
Global $AvailableTRXunits[256] = []InitTRX_01()
[/autoit][autoit][/autoit][autoit]
InitTRX_02()Func InitTRX_01()
[/autoit][autoit][/autoit][autoit]
Global $trxFunctions[14][2] = [["trxInitialize"],["trxIdentify"],["trxAttenuation"],["trxFrequency"],["trxPI"],["trxPS"],["trxTA"],["trxTP"], _
["trxEON_TA"],["trxEON_TP"],["trxEON_PS"],["trxLoadRDS"],["trxEAS"],["trxMode"]]
_ArrayDisplay($trxFunctions, "$trxFunctions without Address")$handle_trxDLL = _WinAPI_LoadLibrary("trxRemote.dll")
[/autoit][autoit][/autoit][autoit]
For $i = 0 To UBound($trxFunctions) - 1
$trxFunctions[$i][1] = _WinAPI_GetProcAddress($handle_trxDLL, $trxFunctions[$i][0])
Next
_ArrayDisplay($trxFunctions, "$trxFunctions with Address")ConsoleWrite("Function: " & $trxFunctions[0][0] & " has Address: " & $trxFunctions[0][1] & @CRLF)
[/autoit][autoit][/autoit][autoit]
$trxString = DllCallAddress("INT", $trxFunctions[0][1], "BYTE*", $NumberOfTRXunits, "INT", $AvailableTRXunits)
If @error Then
switch @error
Case 2
ConsoleWrite("unknown ""return type""")Case 4
[/autoit][autoit][/autoit][autoit]
ConsoleWrite("bad number of parameters")Case 5
[/autoit][autoit][/autoit][autoit]
ConsoleWrite("bad parameter")
EndSwitch
EndIfIf $handle_trxDLL Then $close_trxDLL = _WinAPI_FreeLibrary($handle_trxDLL)
[/autoit][autoit][/autoit][autoit]
ConsoleWrite("$close_trxDLL = " & $close_trxDLL & @CRLF)
EndFuncFunc InitTRX_02()
[/autoit][autoit][/autoit][autoit]
Local $funcReturn = DllCall("trxRemote.dll", "INT", "trxInitialize", "BYTE*", $NumberOfTRXunits, "INT", $AvailableTRXunits)
If @error Then
switch @error
Case 1
ConsoleWrite("unable to use the DLL file" & @CRLF)Case 2
[/autoit][autoit][/autoit][autoit]
ConsoleWrite("unknown ""return type""" & @CRLF)Case 3
[/autoit][autoit][/autoit][autoit]
ConsoleWrite("""function"" not found in the DLL file" & @CRLF)Case 4
[/autoit][autoit][/autoit][autoit]
ConsoleWrite("bad number of parameters" & @CRLF)Case 5
[/autoit]
ConsoleWrite("bad parameter" & @CRLF)
EndSwitch
EndIf
EndFunc
Exit -
Hallo,
ich habe mal Deine $nMsg -Schleife so geändert das es funktioniert.
Hauptproblem war in dem 'FileOpenDialog' Aufruf.Ich hoffe das ich Dir damit ein wenig weiterhelfen konnte.
Spoiler anzeigen
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitCase $filebutton
$soundpath = FileOpenDialog("Sound Datei", @MyDocumentsDir & "\", "Soundfile (*.mp3; *.wav)", 3)
If @error Then
Msgbox(0, "Fehler", "Es wurde keine Datei ausgewählt oder sie hat ein falsches Format")
GUICtrlSetState( $Radio3, $GUI_CHECKED)
EndIfCase $progstart
$exepath = FileOpenDialog("Programmauswahl", @ProgramsDir, "(*.exe)", 3)
If @error Then
Msgbox(0, "Fehler", "Es wurde keine Datei ausgewählt oder sie hat ein falsches Format")
GUICtrlSetState( $Radio4, $GUI_CHECKED)
EndIfCase $progkill
GUICtrlSetData( $List1, "")
_listbox ()Case $Start
$Radio5_r = GUICtrlRead($Radio5)
If $Radio5_r = $GUI_CHECKED Then
If GUICtrlRead( $List1 ) = "0" Then
MsgBox( 0, "Fehler", "In der Programm beenden Funktion wurde nichts ausgewählt")
EndIf
EndIfGUISetState(@SW_HIDE, $Form1)
_count()EndSwitch
WEnd