Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Problem with _FileCreate and FileOpenDialog

$
0
0

Hi,
I have a problem with this code.

AutoIt         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include < file.au3>   ; Local $message = " choose a file."   ; Local $dir3 = FileOpenDialog($message, @WindowsDir & "\", "Images (*.wav;*.bmp)", 1 + 4)   ; Local $file3 = FileOpen($dir3, 0)  ;file che contiene  il wav   ; $data = FileRead ($file3, 1)   ; FileClose ( $file3 ) If Not _FileCreate("pippo.bin") Then            MsgBox(4096, "Error", " Error Creating/Resetting log.      error:" & @error)  EndIf       Local $fbin = FileOpen("pippo.bin",1)       If $fbin = -1 Then              MsgBox(0, "Errore", "Impossibile aprire il file .")              ;Exit       EndIf FileWrite($fbin, @HOUR ) FileWrite($fbin, @MIN ) FileWrite($fbin, @SEC )     FileClose ( $fbin )

When i run the code, it generates a pippo.bin file with the local time.

 

But if  I remove the block comment on the lines 9 and 11 :

 Local $message = " choose a file."  Local $dir3 = FileOpenDialog($message, @WindowsDir & "\", "Images (*.wav;*.bmp)", 1 + 4)

and I run again the program, I choose a wav file , but the creation of pippo.bin isn't working anymore.

 

can someone explain to me why?

 

Thanks in advance.

 

Giorgio.

 

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>