Sign in to follow this  
Followers 0
ekotek

FileOpenDialog Crashing Application...

6 posts in this topic

#1 ·  Posted (edited)

Hey All,

Anyone have an idea as to why consecutive FileOpenDialogs would cause application crash?

The first run-through has no problem...then, I go to do a second FileOpenDialog and if I have my cursor in the file selection area but don't select a file quick enough, it crashes...

Any help would be appreciated...

I'm on AutoIt3...here's the code...

Func btnIMPORTClick()

AutoItSetOption ( "expandenvstrings", 1 )

$frmIMPORTresult = FileOpenDialog ( "Select File To Import", "%userprofile%\desktop","Text files (*.txt)", 3,"ImportList.txt")

If $frmIMPORTresult <> "" Then

$ReadFile=FileOpen($frmIMPORTresult,0)

While 1

$LineRead=FileReadLine($ReadFile)

if @error = -1 then ExitLoop

If $LineRead <> "" then

For $SystemNamesIndex = 0 to _GUICtrlListViewGetItemCount($lstSYSTEMS)-1

$SystemName =_GuiCtrlListViewGetItemText($lstSYSTEMS,$SystemNamesIndex)

If $SystemName = $LineRead Then

_GuiCtrlListViewDeleteItem($lstSYSTEMS,$SystemNamesIndex)

EndIf

Next

GuiCtrlCreateListViewItem($LineRead,$lstSYSTEMS)

EndIf

$LineRead=''

WEnd

FileClose($ReadFile)

EndIf

FileChangeDir($WorkingDir)

$frmIMPORTresult=''

$ReadFile=''

$SystemNamesIndex=0

EndFunc

Edited by ekotek

Share this post


Link to post
Share on other sites



Had darned near the exact same scenario (selection "not fast enough") and the same crash code. I'll troll through my scripts and see if I can find the edit where I finally got it to work without the crash.


- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

Had darned near the exact same scenario (selection "not fast enough") and the same crash code. I'll troll through my scripts and see if I can find the edit where I finally got it to work without the crash.

Okay, so I'm not losing my mind then...always good to know...I look forward to seeing what you came up with...it's weird...hovering over folders doesn't cause the problem at all - it's only hovering over files...bizarre...

Share this post


Link to post
Share on other sites

,

Anyone have an idea as to why consecutive FileOpenDialogs would cause application crash?

There is a known bug in which Win XP suffers from a FileOpenDialog window crash. This is not a AutoIt3 bug. To test, try manually opening notepad and use the OpenFileDialog within the File menu, then moving your mouse over the files of the FileOpenDialog window to bring up the tooltips. You may find on the 1st or sencond open of FileOpenDialog will cause a crash. This is an OS bug and Vista does not suffer from it so far I have seen.

:whistle:

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It's a Windows bug, your code doesn't cause it, Windows does. You can find out all details by using search.

EDIT: MHz was faster. :whistle:

Edited by poisonkiller

Share this post


Link to post
Share on other sites

Yep, testing via Notepad does have the exact same problem. Weird, I've a program I developed in VS2003 and it doesn't suffer the same failings...

Do you know if there is a hotfix for it?

I did some searching, but couldn't find this specific issue referenced.

Share this post


Link to post
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
Sign in to follow this  
Followers 0