Showing results for February 2004 - Page 3 of 4 - The Old New Thing

Feb 11, 2004
0
0

Dunkin Donuts vs. Krispy Kreme

Raymond Chen
Raymond Chen

Having grown up on the east coast, I imprinted on Dunkin Donuts. Once a month we would stop at DD on the way home and buy a shoebox of doughnuts. Toasted coconut and butternut, those were my favorites. Ironically, Dunkin Donuts is really a coffee shop disguised as a doughnut shop. (Doughnuts account for only 20% of their sales; coffee 50%.) So ...

Non-Computer
Feb 11, 2004
0
5

Sure, we do that

Raymond Chen
Raymond Chen

The DirectX video driver interface for Windows 95 had a method that each driver exposed called something like "DoesDriverSupport(REFGUID guidCapability)" where we handed it a capability GUID and it said whether or not that feature was supported. There were various capability GUIDs defined, things like GUID_CanStretchAlpha to ask the driver wh...

History
Feb 10, 2004
0
0

Orkut's privacy policy and terms of service

Raymond Chen
Raymond Chen

It was bound to happen sooner or later. I was invited to join Orkut. But before clicking Submit, I always read the fine print: their Terms of Service and their Privacy Policy. (Oh great, you have to have scripting enabled just to read their Terms of Service and Privacy Policy!) Notice, for example, the terms for changes to their terms of service: ...

Non-Computer
Feb 10, 2004
0
0

Answer to exercise: Pointer to member function cast

Raymond Chen
Raymond Chen

Yesterday's exercise asked you to predict and explain the codegen for the following fragment: Well, the codegen might go something like this: Let's use one of our fancy pictures: Just for fun, I swapped the order of Base1 and Base2. There is no requirement in the standard about the order in which storage is allocated for base classes, so ...

Code
Feb 9, 2004
0
0

I think this counts as having come full circle

Raymond Chen
Raymond Chen

First, ABBA rises to stardom in their native Sweden with Ring, Ring. They then win the Eurovision Song Contest with Waterloo, which is also recorded in English, French, German, and probably Spanish. Twenty-five years later, the English-language musical Mamma-Mia premieres in London and subsequently spreads through large portions of the world not y...

Non-Computer
Feb 9, 2004
0
2

Pointers to member functions are very strange animals

Raymond Chen
Raymond Chen

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

Code
Feb 6, 2004
0
0

Adjustor thunks

Raymond Chen
Raymond Chen

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

History
Feb 5, 2004
0
2

The layout of a COM object

Raymond Chen
Raymond Chen

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

History
Feb 4, 2004
0
0

The Glass Engine and Ishkur's Guide to Electronic Music

Raymond Chen
Raymond Chen

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

Non-Computer
Feb 4, 2004
0
0

Answers to exercises – mismatching new/delete

Raymond Chen
Raymond Chen

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

Code