yxrkt Posted May 12, 2007 Posted May 12, 2007 the first file i open in the fileopendialog works perfect. second time i try to open a file, the script shuts down with the exit code: -1073741819 #include <GuiConstants.au3> $my_gui = GUICreate("MyGUI", 310, 310) $button1 = guictrlcreatebutton('open',1,1,100,25) $edit = guictrlcreateedit('',1,50,300,200) GUISetState() func open() $var = FileOpenDialog("finn en fil.", "", " (*.*)", 3 ) If not @error Then $file = FileOpen($var, 0) $chars = FileRead($file) GUICtrlSetData($edit, $chars) FileClose($file) EndIf endfunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $button1 open() Case Else EndSelect WEnd Exit
xcal Posted May 12, 2007 Posted May 12, 2007 It actually worked fine for me. I'd switch it up just a bit, though... #include <GuiConstants.au3> $my_gui = GUICreate("MyGUI", 310, 310) $button1 = GUICtrlCreateButton('open', 1, 1, 100, 25) $edit = GUICtrlCreateEdit('', 1, 50, 300, 200) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $button1 open() EndSwitch WEnd Func open() $var = FileOpenDialog("finn en fil.", "", " (*.*)", 3) If @error Then Return $file = FileOpen($var, 0) $chars = FileRead($file) GUICtrlSetData($edit, $chars) FileClose($file) EndFunc How To Ask Questions The Smart Way
yxrkt Posted May 12, 2007 Author Posted May 12, 2007 still exits the script.uploaded a video .http://video.google.com/videoplay?docid=-7173122004720575516
yxrkt Posted May 12, 2007 Author Posted May 12, 2007 (edited) hmm.. seems like this is only a problem when i open files from my desktopdir. if i open files from d:\ it doesnt shut down. Edited May 12, 2007 by yxrkt
MHz Posted May 12, 2007 Posted May 12, 2007 Does it crash when a tooltip tries to popup? And are you running on XP? Then there is a windows bug that can cause that. You maybe able to open notepad and select the openfiledialog there and you may find that notepad will crash as well.
yxrkt Posted May 12, 2007 Author Posted May 12, 2007 notepad did crash . yep its XP. i see now that it crashes when a tooltip try to popup.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now