The Old New Thing

Why am I getting LNK2019 unresolved external for my inline function?

More than once, I've seen somebody confused by how inline functions work. I have implemented a few inline functions in one of my cpp files, and I want to use it from other cpp files, so I declare them as extern. But sometimes I will get linker error 2019 (unresolved external) for the inline functions. // a.cpp inline bool foo() { return ...

How to tell the poseurs from the actual Windows developers

Poseurs will call Windows versions by their programmatic version numbers. For example, they will call Windows Vista "NT6" and Windows 7 "NT6.1". Trust me, nobody on the Windows team calls the products by their programmatic version numbers. Whenever anybody says "NT6" I have to go to Wikipedia and look up what they're actually talking ...

Creating a simple pidl: For the times you care enough to send the very fake

I'll assume that we all know what pidls are and how the shell namespace uses them. That's the prerequisite for today. A simple pidl is an item ID list that refers to a file or directory that may not actually exist. It's a way of playing "what if": "If there were a file or directory at this location, here is what I would have created to ...

Any setting you expose to the user you implicitly expose to applications

Often, in response to some sort of design decision, people will say, "Well, sure, you made this decision because it would allow applications to do Bad Thing, but why not expose it as a setting the user can select? For example, let the user pick a Topper Than Topmost Awesome Top Window Super Top (Extra Super edition), and keep that window on ...

How do I get the current value of the RSP register from a C/C++ function? (No answer, but a solution.)

A customer using Visual Studio wanted to know how to obtain the current value of the x64 RSP register from a C/C++ function. They noted that on the x86, you can drop to inline assembly, and on the ia64, you can use the intrinsic to retrieve the value of any register. There is no corresponding intrinsic on x64. There's no really good way of...