The Old New Thing

Answers to exercise from Scrollbars Part 11

Exercise: Why do we use the formula instead of the simpler ? Answer: To avoid integer overflow in the computation of . Here, and are window coordinates, and the window can be anywhere. If the window were placed at extreme coordinates like (MAXLONG,MAXLONG), then the ...

Scrollbars part 12: Applying WM_NCCALCSIZE to our scrollbar sample

Now that we have learned about the intricacies of the message, we can use it to get rid of the flicker in our resizing code. We just take the trick we used above and apply it to the scroll program. First, we need to get rid of the bad flickery resize, so return the OnWindowPosChanging function...

Eric's complete guide to BSTR semantics

Eric Lippert has posted Eric's Complete Guide to BSTR Semantics. This is a document that is widely valued within Microsoft, since BSTR semantics are rather tricky, and I'm glad he's willing to share it with the world. In particular, Eric spends quite a bit of time discussion the very ...

I'm not sure if this was a dare

Joe Beda stopped by my office, clutching a stack of documents he had just had notarized, and told me, "Raymond, you should become a notary public." "Why?" "It'd be fun." "Notarizing documents is fun?" "No, just being a notary public - just...

Whimsical bug reports

Whimsical bug reports, while not a common occurence, aren't exactly unheard of either. They are a popular way to vent a shared frustration and lighten the mood. Recently, we changed milk suppliers for our cafeterias. Well, more accurately, our previous milk supplier was bought by another milk ...