forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

number of rows in list view control

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
Ralf



Joined: 30 Aug 2007
Posts: 54
Location: munich

PostPosted: Fri Dec 05, 2025 5:03 pm    Post subject: number of rows in list view control Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8320
Location: Salford, UK

PostPosted: Fri Dec 05, 2025 5:30 pm    Post subject: Reply with quote

I will aim to take a look at this on Monday.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1278
Location: Morrison, CO, USA

PostPosted: Sat Dec 06, 2025 12:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2959
Location: South Pole, Antarctica

PostPosted: Sun Dec 07, 2025 2:33 am    Post subject: Reply with quote

I got inferiority complex for two decades after I touched bugotron %lv.
GL to you.
Back to top
View user's profile Send private message
Ralf



Joined: 30 Aug 2007
Posts: 54
Location: munich

PostPosted: Tue Dec 09, 2025 8:34 am    Post subject: Re: Reply with quote

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 Crying or Very sad .
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
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1278
Location: Morrison, CO, USA

PostPosted: Tue Dec 09, 2025 3:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ralf



Joined: 30 Aug 2007
Posts: 54
Location: munich

PostPosted: Thu Dec 11, 2025 2:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1278
Location: Morrison, CO, USA

PostPosted: Thu Dec 11, 2025 2:55 pm    Post subject: Reply with quote

Definitely not the cause. Oh well, it was a shot!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group