Silverfrost Forums

Welcome to our forums

number of rows in list view control

5 Dec 2025 4:03 #32523

I have program crashes with listview controls, if the number of rows is getting larger. I was able to reproduce a similar crash with a simple test program:

      winapp 
      Program Test_lv
!=======================================================================  
      integer, parameter :: lv_len = 109      
      integer :: winio@
      character(len=20),dimension(0:lv_len) :: items
      integer :: iw, nitems, view
            
      items(0) = '|Header|Value'
      do i=1,lv_len
        write(items(i),'(a5,i3.3,a1,f7.1)') '|Test',i,'|',float(i)
      enddo
      
      nitems = lv_len+1
      view = 1
            
      iw = winio@ ('%ca[Test lv]&')
      iw = winio@ ('%lv&',200,100,items,nitems,isel,view)
      iw = winio@ ('%ff%nl%cn%`12bt[Close]')
      iw = winio@ ('%ff%nl ')
 
      stop 
      end 

This example crashes with an access violation error in clearwin64.dll for 109 or more rows. With a smaller number of rows it works fine. The 32bit version runs without problems. I am using ftn95 v9.13.

5 Dec 2025 4:30 #32524

I will aim to take a look at this on Monday.

5 Dec 2025 11:53 #32526

I don't see a declaration for 'isel'. This should be dimensioned from 1:lv_len when used with %lv of type=1.

It should be initialized to zero. The appropriate element of the vector will be changed to 1 when a row is selected. You cannot select row=0, hence the dimensioning starting at 1.

7 Dec 2025 1:33 #32529

I got inferiority complex for two decades after I touched bugotron %lv. GL to you.

9 Dec 2025 7:34 #32541

Quoted from wahorger I don't see a declaration for 'isel'. This should be dimensioned from 1:lv_len when used with %lv of type=1.

It should be initialized to zero. The appropriate element of the vector will be changed to 1 when a row is selected. You cannot select row=0, hence the dimensioning starting at 1.

You are right, that was a mistake on my part. However I have still crashes in clearwin64.dll with a lv control using many entries when I try to resize the column size with the mouse. Unfortunately I am not able to reproduce this with a simple test program, so I have to assume that there is still something wrong in my code 😢 . The lv is located on a child window using %lw[owned]. When I remove the %lw[owned] control, the program seems to be stable. So this is my current workaround until I find somthing else...

9 Dec 2025 2:15 #32543

Depending on how your header is defined, you can have issues with resizing.

When you resize a column, it places the number of pixels in the header row (row 0) along with any header options (like + or Minus). If the character length is insufficient to contain this newly modified header, this could be (at least part) of the problem.

In your example, you have 13 characters in the header, resizing one of them will generate a 4 (or 5) character increase for a 3-digit width increase (underscore plus the width in pixels). Do this for both columns, and you are at 21 (or 23) characters.

11 Dec 2025 1:32 #32546

The program, which crashes within the lv, provides a character array with a length of 105 characters. The lv has 4 columns, the header initally looks like this:

items(0)='|No._60|Material_+180|Type_+100|Title_+150'
11 Dec 2025 1:55 #32547

Definitely not the cause. Oh well, it was a shot!

Please login to reply.