Jump to content

_GUICtrlListView_FindInText Crashes


 Share

Recommended Posts

For some reason, when i call said function on SysListView321, it causes the program im accessing the control from to crash, where when i call SysListView322.

This crashes:

;--------FirstListView
local $Drive1
local $Dir1
local $File1
local $Ext1
_PathSplit($From,$Drive1,$Dir1,$File1,$Ext1)
ControlFocus($IP&" - File Transfer","","SysListView321")
$__Control = ControlGetHandle($IP&" - File Transfer","","SysListView321")
local $item = _GUICtrlListView_FindInText($__Control,$Drive1,-1,True,False) ;Crashes Here
_GUICtrlListView_ClickItem(ControlGetHandle($IP&" - File Transfer","","SysListView321"),$item)
ControlListView($IP&" - File Transfer","","SysListView321","Select",$item)
Sleep($DELAY)
Send("{Enter}")

This works:

;--------SecondListView F7 to make new folder
local $Drive2
local $Dir2
local $File2
local $Ext2
_PathSplit($To,$Drive2,$Dir2,$File2,$Ext2)
ControlFocus($IP&" - File Transfer","","SysListView322")
local $item2 = _GUICtrlListView_FindInText(ControlGetHandle($IP&" - File Transfer","","SysListView322"),$Drive2) ;works
_GUICtrlListView_ClickItem(ControlGetHandle($IP&" - File Transfer","","SysListView322"),$item2)
ControlListView($IP&" - File Transfer","","SysListView322","Select",$item2)
Sleep($DELAY)
Send("{Enter}")
Sleep($DELAY)

This code worked on WIndows XP, but doesn't on Windows 7 for some reason. Anyone have any idea what's wrong?

Just in case, here is all the code for the function this is in:

Func Go()
local $username = "****"
local $password = "****"
local $List = _GUICtrlListView_GetItemTextArray($IPLIST)
local $drive
local $dirs
local $count = _GUICtrlListView_GetItemCount($IPLIST)
local $count2 = _GUICtrlListView_GetItemCount($FILIST)
For $i = 0 To $count - 1
$MPROG_d = $i/($count - 1) * 100
$PROG_d = 0
GUICtrlSetData($PROG,$PROG_d)
GUICtrlSetData($MPROG,$MPROG_d)
$IP = _GUICtrlListView_GetItemText($IPLIST, $i)
$COMMAND = $radminExec&$IP&":4899 "&$file
Run($COMMAND)
Sleep($DELAY)
WinWait("Radmin security:")
WinActivate("Radmin security:")
Send($username)
Sleep($DELAY)
Send("{TAB}")
Send($password)
Sleep($DELAY)
Send("{ENTER}")
Sleep($DELAY)
WinWait($IP&" - File Transfer")
WinActivate($IP&" - File Transfer")
WinWaitActive($IP&" - File Transfer")
For $k = 0 To $count2 - 1

$PROG_d = $k/($count2 - 1) * 100
GUICtrlSetData($PROG,$PROG_d)
GUICtrlSetData($MPROG,$MPROG_d)
local $Both = _GUICtrlListView_GetItemTextArray($FILIST,$k)
local $From = $Both[1]
local $To = $Both[2]
;--------SecondListView F7 to make new folder
local $Drive2
local $Dir2
local $File2
local $Ext2
_PathSplit($To,$Drive2,$Dir2,$File2,$Ext2)
ControlFocus($IP&" - File Transfer","","SysListView322")
local $item2 = _GUICtrlListView_FindInText(ControlGetHandle($IP&" - File Transfer","","SysListView322"),$Drive2)
_GUICtrlListView_ClickItem(ControlGetHandle($IP&" - File Transfer","","SysListView322"),$item2)
ControlListView($IP&" - File Transfer","","SysListView322","Select",$item2)
Sleep($DELAY)
Send("{Enter}")
Sleep($DELAY)
local $Dirs2 = _StringExplode($Dir2,"")
For $j = 1 To UBound($Dirs2) - 2
$item2 = ControlListView($IP&" - File Transfer","","SysListView322","FindItem",$Dirs2[$j])
If $item2 == -1 Then
     Send("{F7}")
     Sleep($DELAY)
     Send($Dirs2[$j])
     Sleep($DELAY)
     Send("{ENTER}")
     Sleep($DELAY)
     $item2 = ControlListView($IP&" - File Transfer","","SysListView322","FindItem",$Dirs2[$j])
EndIf
ControlListView($IP&" - File Transfer","","SysListView322","Select",$item2)
Sleep($DELAY)
Send("{Enter}")
Sleep($DELAY)
Next
;--------FirstListView
local $Drive1
local $Dir1
local $File1
local $Ext1
_PathSplit($From,$Drive1,$Dir1,$File1,$Ext1)
$__o = ControlFocus($IP&" - File Transfer","","SysListView321")
$__Control = ControlGetHandle($IP&" - File Transfer","","SysListView321")
local $item = _GUICtrlListView_FindInText($__Control,$Drive1,-1,True,False)
_GUICtrlListView_ClickItem(ControlGetHandle($IP&" - File Transfer","","SysListView321"),$item)
ControlListView($IP&" - File Transfer","","SysListView321","Select",$item)
Sleep($DELAY)
Send("{Enter}")
Sleep($DELAY)
local $Dirs1 = _StringExplode($Dir1&$File1&$Ext1,"")
For $j = 1 To UBound($Dirs1) - 2
$item = ControlListView($IP&" - File Transfer","","SysListView321","FindItem",$Dirs1[$j])
ControlListView($IP&" - File Transfer","","SysListView321","Select",$item)
Sleep($DELAY)
Send("{Enter}")
Sleep($DELAY)
Next
$item = ControlListView($IP&" - File Transfer","","SysListView321","FindItem",$Dirs1[UBound($Dirs1) - 1])
ControlListView($IP&" - File Transfer","","SysListView321","Select",$item)
Sleep($DELAY)
Send("{F5}")
Sleep(2000)
If WinExists("Question") Then
MsgBox(0,"","ERROR: File probably already exists, please remove from list")
Exit
EndIf
local $testString = False
While $testString == False
$testString = (StringInStr(WinGetText($IP&" - File Transfer"),"Sending file",0) == 0)
Sleep($DELAY)
WEnd
For $j = 1 To UBound($Dirs1) - 1
Sleep($DELAY)
ControlFocus($IP&" - File Transfer","","ToolbarWindow321")
ControlCommand($IP&" - File Transfer","","ToolbarWindow321","SendCommandID",2068)
Next
For $j = 1 To UBound($Dirs2) - 1
Sleep($DELAY)
ControlFocus($IP&" - File Transfer","","ToolbarWindow322")
ControlCommand($IP&" - File Transfer","","ToolbarWindow322","SendCommandID",2068)
Next
Next
Sleep($DELAY)
Send("!{F4}")
Sleep($DELAY)
Next
EndFunc

Thanks!

EDIT:

It's 32bit Windows 7 and i'm using the latest autoIt, not the beta

Edited by mv2112

There's no place like ~/

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