NO

Author Topic: Listview progressbar control  (Read 2523 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Listview progressbar control
« Reply #30 on: October 24, 2023, 02:18:27 PM »
In version 1.04 which is the version prior to adding UNICODE(bandaid)

The 64 bit optimization issue is in procedure AddLvProgressBar which is in ListViewProcessBar.c.

The exact line causing the failure is
   lvItem.mask           != LVIF_PARAM;
Under 32 bit this is not an issue with optimization but with 64 bit
optimization it appears to corrupt lvProgress in some manner.

It can be fixed by changing the line to
   lvItem.mask           = LVIF_PARAM; // un-confuse 64 bit optimization
   
Now the program works correctly under both 64 bit optimization and 32 bit optimization.   


John Z
Very good job John!  :D
I've never noted that typo, even after checking the whole file more and more time.
Now it's me that should pay you a a beer or a KEG!  ;D

Everything should be clear now, the wrong statement or'ed the rubbish in the variable with the required flag, then WIN11 strongly checked for invalid flags and aborted, or eventually interpreted them as new flags showing 'chinese' characters.
Win10, easygoing, ignored errors.

P.S. Maybe also ListView_GetSubItemRect macro works now...  :P

OK. I'll continue to stay with WIN10!  8)
« Last Edit: October 24, 2023, 02:26:43 PM by frankie »
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline John Z

  • Member
  • *
  • Posts: 796
Re: Listview progressbar control
« Reply #31 on: October 24, 2023, 02:52:53 PM »
Everything should be clear now, the wrong statement or'ed the rubbish in the variable with the required flag, then WIN11 strongly checked for invalid flags and aborted, or eventually interpreted them as new flags showing 'chinese' characters.
Win10, easygoing, ignored errors.
Well .... I don't think it was rubbish - It should have been 0 because
LISTVIEWPROGRESS *lvProgress = calloc(1, sizeof(LISTVIEWPROGRESS)); // calloc set all to 0
So I think the 64 bit optimizer and Win 11 involved somehow...  Also tried
lvItem.mask = lvItem.mask | LVIF_PARAM;  just in case but it was BAD as well with 64 bit optimization.
Also if rubbish it should still be rubbish without optimization .... yet it works correctly without optimization.
Also as 32 bit, with and without optimization, it worked with lvItem.mask |=   LVIF_PARAM;

P.S. Maybe also ListView_GetSubItemRect macro works now...  :P
  YES see update to prior post.... seems fixed

John

P.S. Last  post on this I think. It is working ....

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Listview progressbar control
« Reply #32 on: October 24, 2023, 03:32:03 PM »
John lvProgress is initialized to 0, but the problem is on lvItem that is an uninitialized local variable.
Evidently the optimization process influence the contents of memory and then what we found inside the uninitialized variable.
Everything is more clear...  :P
At this point the compiler should be ok...  ::)
« Last Edit: October 24, 2023, 03:37:48 PM by frankie »
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline John Z

  • Member
  • *
  • Posts: 796
Re: Listview progressbar control
« Reply #33 on: October 24, 2023, 03:46:02 PM »
frankie - the beer is back to you! 
Yes I saw(incorrectly) it was zeroing everything not noticing it became item instead of progress!  >:( even though I was changing lvItem.mask  DUH!

It is clear now !  Thanks!

John Z

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Listview progressbar control
« Reply #34 on: October 24, 2023, 04:00:21 PM »
frankie - the beer is back to you! 
Yes I saw(incorrectly) it was zeroing everything not noticing it became item instead of progress!  >:( even though I was changing lvItem.mask  DUH!

It is clear now !  Thanks!

John Z
John don't worry, this is a perfectly normal, humane, situation. It is called "motivated perception", we see what stimulate us, what we want see (see).
This happens continuously, we need a bug of the OS or the compiler to stimulate our self-motivation  8).

What about a couple of pints?  ;D
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline John Z

  • Member
  • *
  • Posts: 796
Re: Listview progressbar control
« Reply #35 on: October 25, 2023, 11:43:33 AM »
HI frankie,

Say - don't forget to re-post the 1.04 version at the top of this thread with the fix for your admiring followers !
Was it intentional to use the multithread Lib?

My motivated perception sees that pint as a quart  :) :) :), each....

John Z

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Listview progressbar control
« Reply #36 on: October 25, 2023, 02:55:54 PM »
HI frankie,

Say - don't forget to re-post the 1.04 version at the top of this thread with the fix for your admiring followers !
Was it intentional to use the multithread Lib?
Done.
Yup, it is always better to use multithreaded version because almost everything is multithreaded (almost always concurrent threads are started automatically from SYS calls).

My motivated perception sees that pint as a quart  :) :) :), each....

John Z
Right now I see 2 empty mugs...  ;D
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline John Z

  • Member
  • *
  • Posts: 796
Re: Listview progressbar control
« Reply #37 on: October 26, 2023, 01:59:53 PM »
Very cool frankie!

Not only fixed but enhanced.  Worked fine on the now notorious Win 11  :)

John Z

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Listview progressbar control
« Reply #38 on: October 31, 2023, 03:47:09 PM »
Updated to V2.00.
Right click on each subitem to add, remove and modify progress bar.  ;)
Download from the The first post of this thread.
« Last Edit: October 31, 2023, 07:51:09 PM by frankie »
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline Vortex

  • Member
  • *
  • Posts: 802
    • http://www.vortex.masmcode.com
Re: Listview progressbar control
« Reply #39 on: October 31, 2023, 05:41:49 PM »
Hi frankie,

Version 2.00 works fine on Windows 7 64-bit. Thanks.
Code it... That's all...

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Listview progressbar control
« Reply #40 on: October 31, 2023, 07:46:41 PM »
Hi frankie,

Version 2.00 works fine on Windows 7 64-bit. Thanks.
Thanks Erol, I hope it works in W11 too...  :)
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline John Z

  • Member
  • *
  • Posts: 796
Re: Listview progressbar control
« Reply #41 on: October 31, 2023, 10:28:17 PM »
[Thanks Erol, I hope it works in W11 too...  :)

Works like a charm frankie,  great work, and useful feature too. 
Yes, WIN 11 22H2 with PellesC V12, built it and ran it - no issues

John Z

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Listview progressbar control
« Reply #42 on: November 01, 2023, 12:11:37 AM »
Works like a charm frankie,  great work, and useful feature too. 
Yes, WIN 11 22H2 with PellesC V12, built it and ran it - no issues

John Z
Thanks John
Happy it works well.  :)
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline Vortex

  • Member
  • *
  • Posts: 802
    • http://www.vortex.masmcode.com
Re: Listview progressbar control
« Reply #43 on: November 01, 2023, 01:53:32 PM »
Hi frankie,

The test is successfull, V2.0 works on Windows 11 22 H2, Microsoft Windows [Version 10.0.22621.2428]
Code it... That's all...

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: Listview progressbar control
« Reply #44 on: November 01, 2023, 01:56:24 PM »
Nice to hear, that this site have couple active testers for Win 11 and it's very good thing.
May the source be with you