The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Why can't I GetProcAddress for CreateWindow?
Occasionally, I'll see people having trouble trying to for functions like or . Usually, it's coming from people who are trying to write p/invoke signatures, for p/invoke does a under the covers. Why can't you for these functions? Because they're not really functions. They're function-like macros: In fact, as you can see above is doubly a macro. First, it's a redirecting macro that expands to either or , depending on whether or not you are compiling . Those are in turn function-like macros that call the real function or . All this is handled by the compiler if you include the header file, but if for ...
The family technical support department: Everything is Outlook
We're all in the same position. Since we work with computers all day, everybody in the extended family considers us the technical support department. One thing you all need to take away from your role as family technical support department is that normal people view computers completely differently from the way you and I do. One of my relatives calls every program Outlook. "I'm on the Internet checking the weather report and then Outlook keeps displaying these windows with advertisements in them." "I'm having trouble listening to music on Outlook." "How do I get Outlook to play that card game you showed me la...
2006 end-of-year link clearance
A few random links that I've collected. And then the obligatory plug for my column in TechNet Magazine: And then the obligatory book plug: The electronic-only PDF version is now available for purchase, and it's cheaper than the dead tree edition. (Don't forget that the dead tree edition comes with 45 days of free access to the electronic edition.) My prediction? "Jim Allchin will retire on November 13, 2006." I was wrong. I based my prediction on the fact that Microsoft announced that Allchin "plans to retire at the end of calendar year 2006 following the commercial availability of Windows Vista." The...
Stop the madness: Subdirectories of My Documents
As a follow-up to the difference between My Documents and Application Data, I'd like to rant about all the subdirectories of My Documents that programs create because they think they're so cool. I'm sure there are more. Everything in the My Documents folder the user should be able to point to and say, "I remember creating that file on such-and-such date when I did a 'Save' from Program Q." If it doesn't pass that test, then don't put it into My Documents. Use Application Data. And don't create subdirectories off of My Documents. If the user wants to organize their documents into subdirectories, that's ...
Linda Hunt's advice for Oscar-winners
Academy-award winning actress Linda Hunt reminds newer Oscar-winners, "It's not about you."
The social skills of a thermonuclear device, part 3
Some years ago, a group different from the one I worked in invited me to "volunteer" to help them with serious problems they were having with their product. They asked to "borrow" me for one week so that I could magically resolve all their issues. I wasn't really that familiar with their product, and I certainly didn't know how it worked internally, so I didn't think I could actually be much help given just one week. But they kept insisting that I "volunteer" to help them, until I finally wrote, I have a lot of vacation days and I'm not afraid to use them. That one line catapulted me into thermonuclear device ...
I can't believe they actually can't think of a name for the recent storm
The Seattle Times reports that the National Weather Service is inviting suggestions from the public on what to call the recent windstorm. They're baffled because "the storm didn't fall on a holiday." Huh? The storm blew in on the evening of the 14th, but its effects weren't really felt until the morning of the 15th, and the first dark night for everyone was... the first night of Hanukkah, the Festival of Lights. Everybody in the Seattle area was lighting candles and celebrating Hanukkah (mostly unwittingly). Gosh, I wonder what we should call this storm? If you have any ideas, send your suggestion to namethew...
The first parameter to VerQueryValue really must be a buffer you obtained from GetFileVersionInfo
The documentation for the function states that the first parameter is a "pointer to the buffer containing the version-information resource returned by the function." Some people, however, decide to bypass this step and pass a pointer to data that was obtained some other way, and then wonder why doesn't work. The documentation says that the first parameter to must be a buffer returned by the function for a reason. The buffer returned by is an opaque data block specifically formatted so that will work. You're not supposed to look inside that buffer, and you certainly can't try to "obtain the data some othe...
The Old New Thing book will also be available electronically
We interrupt this religious holiday for an important commercial announcement. As a special Christmas present, my new best friends at Addison-Wesley sent me an advance copy of the dead-tree edition of my book. (Obligatory plug: Order it from Amazon. You know I want you to.) One commenter asked whether my book would be available electronically. On the copyright page of the book (that's the back side of the title page) there is a section titled This Book Is Safari Enabled. You can follow the instructions there to gain access to the online edition of the book for 45 days. I'm told that the electronic editio...