The Old New Thing

If you want to use a name for your file mapping, don’t just use the name of the file itself

The original question from the customer was why they couldn't get named file mappings to work at all, but it turns out that the reason is that they were using the full path to the file as the name, even though backslashes have special meaning in file mapping names. Okay, that problem can be solved by changing the backslash to some character...
Comments are closed.0 0
Code

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 ...
Comments are closed.0 0
Code

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 ...

Reading mouse input from a console program, and programmatically turning off Quick Edit mode

Today's Little program shows how to read mouse input from a console program. You might use this if you are writing a console-mode text editor with mouse support, or maybe you want to want to add mouse support to your roguelike game. But I'm not going to implement the game itself. Instead, I'm just going to print mouse coordinates to the ...
Comments are closed.0 0
Code

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 ...
Comments are closed.0 0
Code

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 __getReg intrinsic to retrieve the value of any register. There is no corresponding __getReg intrinsic on x64. There's no ...
Comments are closed.0 0
Code

Feedback usabilla icon