Showing results for 2014 - Page 29 of 31 - The Old New Thing

Jan 27, 2014
0
0

How can I make a callback function a member of my C++ class?

Raymond Chen
Raymond Chen

Instead of a Little Program today, I'm going to answer a Little Question. This is a common beginner question, but I figure I'll just spell it out right here for posterity. First of all, you probably noticed that you can't do this: That's because the is declared as a so-called free function, but member functions are not free. Neither are func...

Code
Jan 24, 2014
0
0

Non-psychic debugging: Looking for leaked objects by their vtable

Raymond Chen
Raymond Chen

A programmer on the GHI team reported that they were hitting an assertion failure using an internal library and asked for help debugging it. I didn't work on this internal library, but on the other hand I'm also not afraid to look inside and around. The assertion failure said, "Assertion failed: All widgets from a factory must be destroyed be...

Code
Jan 23, 2014
0
0

The Visual Effects dialog box just tells you what you want to hear

Raymond Chen
Raymond Chen

The Visual Effects dialog box has three options, "Let Windows choose what's best for my computer," "Adjust for best appearance," and "Adjust for crappiest appearance best performance." Some people have discovered the registry key where the Visual Effects dialog box remembers which radio button was most recently checked, but they found that when the...

Tips/Support
Jan 22, 2014
0
0

What clock do MSG.time and GetMessageTime use?

Raymond Chen
Raymond Chen

The structure has a field called which is a . There is also a function which returns a . Both are documented as returning the time the message was generated, but the types are different. Are these time units comparable? Yes, they are the same thing. They all use the 32-bit timer provided by the function. Sorry about the inconsistency in sign...

Code
Jan 21, 2014
0
0

When the Web page says that a tool is not supported, it means that if you find a problem and contact technical support, they're just going to point you back to the Web page

Raymond Chen
Raymond Chen

I file this under the category of People refuse to read what is right in front of them. There used to be a number of utilities available for download which all go by the name PowerToys. And they all contain text like this: Note: We take great care to ensure that PowerToys work as they should, but they are not part of XYZ and are not supported b...

Other
Jan 17, 2014
0
0

Psychic debugging: Why messages aren't getting processed by your message pump

Raymond Chen
Raymond Chen

The second parameter to the is an optional window handle that is used to tell the function to retrieve only messages that belong to the specified window. A filtered is nearly always a bad idea, because your program will not respond to messages that don't meet the filter. Unlike a filtered (which simply returns "no messages satisfy the filter...

Code