Strange graphics bug

The place for threads about TimoSoft LabelControls.
User avatar
TiKu
Administrator
Administrator
Posts: 830
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Strange graphics bug

Post by TiKu » 08 Oct 2013, 20:44

That's why I wrote that I do not like this solution... I'll search for another solution. :(
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!

User avatar
TiKu
Administrator
Administrator
Posts: 830
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Strange graphics bug

Post by TiKu » 08 Oct 2013, 22:09

God, sometimes I want to kill somebody at Microsoft. :twisted:
The COM interfaces for windowless controls provide two methods for triggering a redraw cycle: InvalidateRect and InvalidateRgn. According to the docs, the only difference between them is that one of them invalidates a rectangular area while the other invalidates a GDI region. According to the docs both of them can be used to invalidate the entire control area by passing NULL instead of a rectangle or a region.
Well, ATL uses InvalidateRect internally and I also tried it myself last week when I tried to fix the drawing issues. But InvalidateRect doesn't work. It is somehow broken. It won't erase the background of the control even if you tell it to do so. As, according to the docs, InvalidateRgn isn't really different from InvalidateRect, I didn't bother giving it a try. Well, I should have done, as it works like a charme.
So I could remove my hackish solution (calling the container control's Refresh method) again and replace it with a one-liner which calls InvalidateRgn. ARGH!

Please try this version and tell me whether it works:
http://www.timosoft-software.de/stuff/l ... 72-rel.zip
http://www.timosoft-software.de/stuff/L ... elease.exe
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!

baron
Lt. Commander
Posts: 31
Joined: 21 Sep 2013, 18:55

Re: Strange graphics bug

Post by baron » 09 Oct 2013, 10:49

Looking great on my tests so far. It even fixed this new label refresh issue that I was trying to reproduce and report to you. Thanks!

I don't think I've ever used Microsoft API or programmed an addon in a Microsoft environment without regretting it. Their complexities, quirks and bugs know no bounds. Except VB6 itself that is.

Post Reply