Jump to content

Controllistview FindItem command always returns 0


Recommended Posts

$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
Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

$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
Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

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