listview20wndclass subitem selection problems
I have a listview with 5 headers. I'm trying to access the items in my list using the list_get_subitem function, but I error out. The error message I get is "...Error:function '_list_get_subitem': external declaration does not match the _list_get_subitem ( hWnd, item_num, subitem_num, subitem);"
Then I tried using the list_get_selected function and it only returns the value of the first column of the selected list.
Has anyone ran into any similar problems?
Re: listview20wndclass subitem selection problems
Found it in the KB
Problem ID: 19237
Diagnosis:There are two _list_get_sub_item functions, one is the WinRunner system function and the other is in the CSO Library. This error message occurs as both the functions have the same name and different prototypes.
Solution: Open the cso32lib file and comment out the list_get_sub_item function
Open the cso32lib file in the <WinRunner>\lib directory and comment out the list_get_subitem function.
# public function list_get_subitem ( in obj, in item_num, in subitem_num, out subitem )
# auto rc, hWnd;
# rc = obj_get_info ( obj, "handle", hWnd );
# if ( rc == E_OK )
# _list_get_subitem ( hWnd, item_num, subitem_num, subitem );
# return rc;
To stop the error from occurring, you need to comment out the list_get_subitem function. However it would probably be best to comment out all references to the list_get_subitem function in the cso32lib script. This includes the generator_add_function lines (around line 98 in the cso32lib script) and the declaration of the _list_get_subitem function (around line 214.) Note, the list_get_subitem function can be used within other functions, such as the list_select_item_by_column function. Do not comment out those lines.