| View previous topic :: View next topic |
| Author |
Message |
Ralf
Joined: 30 Aug 2007 Posts: 54 Location: munich
|
Posted: Fri Dec 05, 2025 5:03 pm Post subject: number of rows in list view control |
|
|
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:
| Code: |
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. |
|
| Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8320 Location: Salford, UK
|
Posted: Fri Dec 05, 2025 5:30 pm Post subject: |
|
|
| I will aim to take a look at this on Monday. |
|
| Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1278 Location: Morrison, CO, USA
|
Posted: Sat Dec 06, 2025 12:53 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2959 Location: South Pole, Antarctica
|
Posted: Sun Dec 07, 2025 2:33 am Post subject: |
|
|
I got inferiority complex for two decades after I touched bugotron %lv.
GL to you. |
|
| Back to top |
|
 |
Ralf
Joined: 30 Aug 2007 Posts: 54 Location: munich
|
Posted: Tue Dec 09, 2025 8:34 am Post subject: Re: |
|
|
| wahorger wrote: |
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... |
|
| Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1278 Location: Morrison, CO, USA
|
Posted: Tue Dec 09, 2025 3:15 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Ralf
Joined: 30 Aug 2007 Posts: 54 Location: munich
|
Posted: Thu Dec 11, 2025 2:32 pm Post subject: |
|
|
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:
| Code: |
items(0)='|No._60|Material_+180|Type_+100|Title_+150'
|
|
|
| Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1278 Location: Morrison, CO, USA
|
Posted: Thu Dec 11, 2025 2:55 pm Post subject: |
|
|
| Definitely not the cause. Oh well, it was a shot! |
|
| Back to top |
|
 |
|