Forum Discussion

MichaelP's avatar
MichaelP
Contributor
13 years ago

Can't get description text from list items in sysListView32 control

The application I am testing has a sysListView32 control, which I obtain with the following:




 p = Sys.Process("NXPowerLite").Popup("Results");


  ListView = p.List("Status");



I can click on each line in the list view control and obtain the description and write it to the log e.g:




File1 = Aliases.dlgResults.listStatus.listitem.Description;


Log.Message(File1);



which results in this log message:



File: C:\Automate...\Ezorder01 - Copy (4).xlsx, Original: 1.3 MB, Optimized: 1003 KB, %: 22% 10:16:08 Normal



R
ather than clicking on each item individualy, I need to get all the items in the list (the size of which may not be known in advance) and write each items description to the log.



I have tried various examples in the help documentation but can't do it.



Any help would be greatly appreciated.

Thanks!



7 Replies

  • Actually, the control is a MFC CList Control



    I have tried variations of the following with no success:




    ListBox = Aliases.dlgResults.listStatus


     


     for (i = 0; i < ListBox.ChildCount; i++)


      {


        Item = ListBox.ListItem(i);


        Log.Message(Item);


      }


     


     


    It doesn't seem to matter if I use wItem, Item, wItemCount, ChildCount, it will always return a blank entry in the log for each item in the list.

  • Hi Michael,



    Maybe, the problem is that you forgot Description? Try the following code:



    ListBox = Aliases.dlgResults.listStatus



    for (i = 0; i < ListBox.ChildCount; i++)

    {

      Item = ListBox.ListItem(i);

      Log.Message(Item.Description);

    }

  • Hi Mike



    I'm sorry I should mentioned I tried that.  It results in "Invalid number of arguments" on the following line:



    Item = ListBox.ListItem(i);



    Thanks.



    Michael
  • I also tried the following:




    for (i = 0; i < ListBox.wItemCount; i++)


      {


        Item = ListBox.wItem(i)


        Log.Message(Item.Description);


      }



    but this results in a blank line for each item - no description present.  Very weird...



    Michael

  • Hi Michael,



    Please reproduce the problem, pack the folder containing your project suite and send me the archive within the support case you submitted. This video shows what files must be included.
  • Mike 



    The zip archive is 76MB and is not sending.  Can I use YouSendIt to send to  

    QA-Support@SmartBear.com ?



    Michael