The Old New Thing

How do the FILE_SHARE_* bits interact with the desired access bits?

It's really not that complicated. If you permit, say, , then you're saying, "I'm okay with other people reading this file while I have it open." And if you leave off the flag, then you're saying, "I do not want other people reading this file while I have it open." Now all that's left to do is work out what that means. So suppose you ...

Links about COM threading models

There have been a few good articles about threading models, one from Eric Lippert and another from Larry Osterman. Go off and read them if you haven't already...

There are two types of scrollbars

Remember that there are two types of scrollbars. One is the standalone scrollbar control. This one has its own window handle, and consequently can be given focus and all those other fun things you can do with window handles. To manipulate them, pass the handle to the scrollbar control to the appropriate scrollbar function (...

Batman and Robin patrolling Whitley

Batman and Robin have been spotted in Whitley, providing valuable services like rescuing damsels in distress (pushing her car to the nearest petrol station), scaring away potential muggers, and even chasing streakers off a football pitch...

When should your destructor be virtual?

When should your C++ object's destructor be virtual? First of all, what does it mean to have a virtual destructor? Well, what does it mean to have a virtual method? If a method is virtual, then calling the method on an object always invokes the method as implemented by the most heavily derived class. If the method is not virtual, then the ...

Scripting is a two-edged sword

A three line VB script will disable your firewall. The advantage of scripting is that you can control so many things with just a few lines of code. The disadvantage of scripting is that bad people can control so many things with just a few lines of code. I wonder how long it will be before there's a virus that disables the firewall...

Chris Pratley's history lesson

If you haven't read it yet, check out Chris Pratley's voluminous discourse on various aspects of the history of Word. It packs more history into one entry than I do all year. And that was a sequel! You can read the first half, too. In fact, the good stuff keeps on coming. just read it all...