Jump to content

Recommended Posts

Posted (edited)

$CLVItem = Controllistview("classname=title", "", "syslistview321", "FindItem", "The Item")

I am using autoit to navigate a syslistview32 control that is embedded in my product. The machine is a 32 bit os. Count and Select commands work fine. I added classname= because I had seen it in one of the forums and my program crashed due to a memory access violation without it.

FindItem always returns 0. Any ideas?

Thanks!

*******************************************************************************************************************

EDIT: After removing 'classname=', @error is zero and FindItem always returns -1. Any ideas appreciated. Thanks!

*******************************************************************************************************************

Edited by rwagnes
Posted (edited)

$CLVItem = Controllistview("title", "", "syslistview321", "FindItem", "The Item") always returns -1 and crashes my program. Any ideas why? Thanks!

My program's log is full of memory access violations..

Edited by rwagnes
Posted (edited)

With the following code, autoit returns @error=0 and $CLVItem=-1:

WinWaitActive("title", "")
    $count = ControlListView("title", "", "SysListView321", "GetItemCount")
    MsgBox(0, "FINDITEM 1", "")
    ControlFocus("title", "", "SysListView321")
    $CLVItem = ControlListView("title", "", "SysListView321", "FindItem", "Item")
    MsgBox(0, "FINDITEM 1", @error)
        
    if $CLVItem <> -1 Then
        MsgBox(0, "Exists", $CLVItem)
    Else 
        MsgBox(0, "Does Not Exist", $CLVItem)
    EndIf
    MsgBox(0, "test", $count)

For some reason, I can suddenly no longer reproduce the memory issue. I must've changed something, but I still can't get the FindItem to work. Any ideas? Thanks!

And thanks MvGulik for your help!

Edited by rwagnes

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
×
×
  • Create New...