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

Dec 13, 2004
0
0

Tintin goes to the neurologist

Raymond Chen
Raymond Chen

The Canadian Medical Association Journal traditionally runs an offbeat research paper in their Christmas edition, for which there is apparently huge competition. This year, Tintin goes to the neurologist. The feedback is fun to read too. (External news coverage here and here.) My first exposure to Tintin was—of course—in Sweden. ...

Non-Computer
Dec 13, 2004
0
0

Why do I get E_NOINTERFACE when creating an object that supports that interface?

Raymond Chen
Raymond Chen

I've seen a few questions from people who call the function, asking for an interface that they know the object supports, yet receiving error . What's going on? You're seeing the same problem as the missing IMarshal, just from the other side. If your threading model is incompatible with the threading model of the object you're creating, then...

Code
Dec 10, 2004
0
0

Dragging a shell object, part 5: Making somebody else do the heavy lifting

Raymond Chen
Raymond Chen

Creating that drag image was a bit of work. Fortunately, the listview control is willing to do some of the work for you. Throw away the OnLButtonDown function (and the HANDLE_MESSAGE that goes with it). Instead, we'll make the listview do all our presentation for us. BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpcs) { g_hwndChild = CreateWindow(...

Code
Dec 10, 2004
0
0

For all your chicken sequencing needs

Raymond Chen
Raymond Chen

The International Chicken Sequencing Consortium announced that it has completed the sequencing of chicken DNA. I repeat: There is an organization called "The International Chicken Sequencing Consortium". (For some reason I want to think these people get together and decide, "Okay, Ginger goes first, then Bunty, then Babs...")

Non-Computer
Dec 9, 2004
0
0

Dragging a shell object, part 4: Adding a prettier drag icon

Raymond Chen
Raymond Chen

You may have noticed that the drag feedback is rather sad-looking. Just a box, maybe with a plus sign or an arrow; you don't even know what it is you're dragging. Let's fix that. We'll drag the icon of the file around. We'll need to add the drag image to the data object. void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyF...

Code
Dec 9, 2004
0
0

Time to dust off your conspiracy theories

Raymond Chen
Raymond Chen

When I started studying Swedish, my web searches happened to alight upon Francis Strand's blog thanks to its wonderful title, "How to learn Swedish in 1000 difficult lessons", and I've been following his musings on life on Stockholm ever since. Wednesday morning, an apartment just a block away from his own exploded under curious circumstances. ...

Non-Computer
Dec 8, 2004
0
0

It is not illegal to use James Bond style tactics for winning at the roulette wheel

Raymond Chen
Raymond Chen

In an operation straight out of a James Bond movie, a trio of gamblers used a laser range-finder hidden in a mobile phone to predict the likeliest landing spot of a roulette ball, reducing the odds from 37-1 to 6-1. Scotland Yard concluded that they did nothing illegal and were allowed to keep their winnings. I wonder how long it'll be befor...

Non-Computer
Dec 8, 2004
0
0

Dragging a shell object, part 3: Detecting an optimized move

Raymond Chen
Raymond Chen

We were considering how to detect that the drag/drop operation resulted in a conceptual Move even if the DROPEFFECT_MOVE was optimized away. If the drop target is the shell, you can query the data object for CFSTR_PERFORMEDDROPEFFECT to see what the performed effect was. void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x...

Code
Dec 7, 2004
0
0

Researchers find connection between lack of sleep and weight gain

Raymond Chen
Raymond Chen

Shortage of sleep is linked to obesity , according to research published yesterday. Lack of sleep boosts levels of a hormone that triggers appetite and lowers levels of a hormone that tells your body it is full according to the team. The scientists will now study whether obese people should sleep more to lose weight.

Non-Computer
Dec 7, 2004
0
0

Dragging a shell object, part 2: Enabling the Move operation

Raymond Chen
Raymond Chen

Let's say that we did want to support Move in our drag/drop program, for whatever reason. Let's do it with some scratch file instead of clock.avi, though. Create a file somewhere that you don't mind losing; let's say it's C:\throwaway.txt. Change the function OnLButtonDown as follows: void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, ...

Code