Jump to content

FileOpenDialog @error


 Share

Recommended Posts

Never had anything like this happen before. Tried to open a driver inf file that was corrupt and the whole thing crashed!

$of_T9Button4 = FileOpenDialog("Select Driver Inf", GUICtrlRead($T9Input1), "Inf Files (*.inf)", 1, "")

Tried If @error Then Return     also tried a msgbox still crashed

Exit code : 1 but not showing any errors

Edited by trashy
Link to comment
Share on other sites

The FileOpenDialog only returns the path to the file you select, i.e. <FilePath>\filename.inf, there is no error checking on the file itself as far as I'm aware, except for the flags i.e. only if file exists, so the error has to be coming from somewhere else are you able to post more of your script?

Link to comment
Share on other sites

I solved the corrupt inf file problem.

Now something very odd with the Recursive file search process you wrote for me.

Just stopped by to update both threads

Case $T9Button4
            $of_T9Button4 = FileOpenDialog("Select Driver Inf", GUICtrlRead($T9Input1), "Inf Files (*.inf)", 1, "")
            GUICtrlSetData($T9Input3, $of_T9Button4)
            If GUICtrlRead($T9Input3) = "" Then
                Return
            Else
                $file = GUICtrlRead($T9Input3)
                $text = FileRead($file)
                $entry1 = _StringBetween($text, "[VERSION]", "[")
                $entry2 = _StringBetween($text, "[Manufacturer]", "[")
                If @error Then
                    MsgBox($MB_SYSTEMMODAL, "", "The driver inf file is not valid.");<<<<this fixed it
                    Return
                EndIf
                GUICtrlSetData($T9Edit2, "Driver Info" & @CRLF & @CRLF & "[Version]" & $entry1[0] & "[Manufacturer]" & $entry2[0])
            EndIf

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...