Raymond Chen

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

Post by this author

Pointers to member functions are very strange animals

Pointers to member functions are very strange animals. Warning: The discussion that follows is specific to the way pointers to member functions are implemented by the Microsoft Visual C++ compiler. Other compilers may do things differently. Well, okay, if you only use single inheritance, then pointers to member functions are just a ...

Adjustor thunks

Yesterday we learned about the layout of COM objects and I hinted at "adjustor thunks". If you find yourself debugging in disassembly, you'll sometimes find strange little functions called "adjustor thunks". Let's take another look at the object we laid out last time: In the diagram, p is the pointer returned when the IPersist interface...

The layout of a COM object

The Win32 COM calling convention specifies the layout of the virtual method table (vtable) of an object. If a language/compiler wants to support COM, it must lay out its object in the specified manner so other components can use it. It is no coincidence that the Win32 COM object layout matches closely the C++ object layout. Even though COM ...

Answers to exercises – mismatching new/delete

Answers to yesterday's exercises: What happens if you allocate with scalar "new" and free with vector "delete[]"? The scalar "new" will allocate a single object with no hidden counter. The vector "delete[]" will look for the hidden counter, which isn't there, so it will either crash (accessing nonexistent memory) or grab a random number ...

The Glass Engine and Ishkur's Guide to Electronic Music

The Glass Engine is an interactive guide to the music of Philip Glass, organized by... um... at least they're organized. By something. Bizarre yet oddly compelling. (Perhaps if we ask nicely, we can get Marc Miller to tell the story of the time he actually met Philip Glass...) In a similar vein, a friend of mine directed me to Ishkur's Guide ...

Mismatching scalar and vector new and delete

In a previous entry I alluded to the problems that can occur if you mismatch scalar "new" with vector "delete[]" or vice versa. There is a nice description of C++ memory management in C++ Gotchas: Avoiding Common Problems in Coding and Design on www.informit.com, and I encourage you to read at least the section titled Failure to ...

What goes wrong when you add "Copy To" to the context menu

Lockergnome tipped people off to this page which talks (among other things) about adding "Copy To" to the context menu. I considered adding this tweak to Tweak UI but ultimately decided against. Here's why: The "Copy to Folder" and "Move to Folder" options weren't designed to be on the context menu. They were only meant to be placed in ...

The management of memory for resources in 16-bit Windows

A multi-step process.

"Section 419" scammers arrested in Netherlands; Danish flag flies proudly

Dutch police have arrested 52 people suspected of defrauding gullible Internet users in one of the largest busts of the infamous "Nigerian e-mail" scam. Hooray for the Dutch police. Their next target: Web sites that illustrate a Dutch article with the Danish flag. (I must sheepishly admit that I too mistakenly identified the home of Ikea as ...

How do we decide what features make it into a product?

David Lemson has an excellent article titled How do we decide what features make it into Exchange?. Although he's talking about Exchange specifically, the general principles apply to many products...