Jump to content

Crash after loading while loaded?...


Rad
 Share

Recommended Posts

Just so you know, memfield is the text area and membtn3 is the "Open" button

Case $msg = $mem_btn3
        $backup=GUICtrlRead($mem_field)
        GUICtrlSetData($mem_field,"")
        $file=FileOpenDialog("Import Trigger Data", @DesktopDir, "Text files (*.txt)",1)
        If @error <> 1 Then 
            GUICtrlSetData($mem_field,FileRead($file,1024))
        Else
            GUICtrlSetData($mem_field,$backup)
        Endif

Now for some strange reason the first time you load it works like a charm, the second time you can load but you have to be VERY quick. If you hover your mouse on a .txt file at the preloaded directory, it will get probrably to where the little box pops up saying the program name/type/size... then BAM my program crashes.

Any reason why? :lmao:

Link to comment
Share on other sites

  • Moderators

Just so you know, memfield is the text area and membtn3 is the "Open" button

Case $msg = $mem_btn3
        $backup=GUICtrlRead($mem_field)
        GUICtrlSetData($mem_field,"")
        $file=FileOpenDialog("Import Trigger Data", @DesktopDir, "Text files (*.txt)",1)
        If @error <> 1 Then 
            GUICtrlSetData($mem_field,FileRead($file,1024))
        Else
            GUICtrlSetData($mem_field,$backup)
        Endif

Now for some strange reason the first time you load it works like a charm, the second time you can load but you have to be VERY quick. If you hover your mouse on a .txt file at the preloaded directory, it will get probrably to where the little box pops up saying the program name/type/size... then BAM my program crashes.

Any reason why? :lmao:

Did you try Clearing $file like you did the $mem_field to see if that worked?

Case $msg = $mem_btn3
        $backup=GUICtrlRead($mem_field)
        GUICtrlSetData($mem_field,"")
        $file = ''
        $file=FileOpenDialog("Import Trigger Data", @DesktopDir, "Text files (*.txt)",1)
        If @error <> 1 Then 
            GUICtrlSetData($mem_field,FileRead($file,1024))
            FileClose($file)
        Else
            GUICtrlSetData($mem_field,$backup)
        Endif

Edit: Just noticed you were using FileRead()... Are you closing the file at all?

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

maybe try this

Case $msg = $mem_btn3
    $backup = GUICtrlRead($mem_field)
    GUICtrlSetData($mem_field, "")
    $file = FileOpenDialog("Import Trigger Data", @DesktopDir, "Text files (*.txt)", 1)
    If @error <> 1 Then
        GUICtrlSetData($mem_field, FileRead($file, FileGetSize($file)))
    Else
        GUICtrlSetData($mem_field, $backup)
    EndIf

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Developers

Which AutotIt version is gving this problem ?

Try the Latest BETA to see if the problem still exists.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...