Showing results for November 2009 - Page 2 of 4 - The Old New Thing

Nov 20, 2009
0
0

The difference between assignment and attachment with ATL smart pointers

Raymond Chen
Raymond Chen

Last time, I presented a puzzle regarding a memory leak. Here's the relevant code fragment: The problem here is assigning the return value of to a smart pointer instead of attaching it. The function creates a memory stream and returns a pointer to it. That pointer has a reference count of one, in accordance with COM rules that a function ...

Code
Nov 19, 2009
0
0

We're using a smart pointer, so we can't possibly be the source of the leak

Raymond Chen
Raymond Chen

A customer reported that there was a leak in the shell, and they included the output from Application Verifier as proof. And yup, the memory that was leaked was in fact allocated by the shell: On the other hand, is an object creation function, so it's natural that the function allocate some memory. The responsibility for freeing the memory be...

Code
Nov 18, 2009
0
0

How do I move the Windows.edb and other search index files?

Raymond Chen
Raymond Chen

Nothing profound today, just a little tip. My customer is looking out for a way to change the location of the windows.edb file to another (larger) drive. From the Indexing Options Control Panel, click Advanced, and then under Index location, click Select new.

Tips/Support
Nov 17, 2009
0
0

We found the author of Notepad, sorry you didn't go to the award ceremony

Raymond Chen
Raymond Chen

I've received independent confirmations as to the authorship of Notepad, so I'm inclined to believe it. Sorry you didn't get to go to the award ceremony. The original author of Notepad also served as the development manager for Windows 95. His job was to herd the cats that made up the programmers who worked on Windows 95, a job which yo...

History
Nov 17, 2009
0
0

How to tell when your patent has been approved

Raymond Chen
Raymond Chen

There are a variety of ways of finding out when your patent is granted, but the quickest mechanism is to check your mailbox. But the thing to look for is not what you might think. Even before you receive word from your company's patent department, you will start receiving junk mail delivered to your home address from companies that sell patent-...

Non-Computer
Nov 16, 2009
0
0

How to pretend that you attended my talk at UIUC Reflections|Projections 2009

Raymond Chen
Raymond Chen

Step 1: Buy a 1.55-ounce Hershey's Milk Chocolate Bar from a convenience store, supermarket, or (if truly desperate) online. Step 2: Print out this candy bar wrapper. Step 3: Trim wrapper on registration marks and wrap around candy bar. Step 4: Stay up late the night before you plan on watching the video by partying with Ryan North and t...

Other
Nov 16, 2009
0
0

Why does shlwapi import a nonexistent function?

Raymond Chen
Raymond Chen

Commenter charless asks why shlwapi.dll imports a nonexistent function from mpr.dll, which shows up in dependency tools as a broken import. Because that function did exist at one point, although it doesn't exist any more. The function in question was available only on Windows 95-series versions of Windows. It never existed on Windows N...

History
Nov 13, 2009
0
0

What a drag: You can be a drag in managed code, too

Raymond Chen
Raymond Chen

David Anson digests my earlier series on virtual drag/drop and translates it into managed code. His example of dragging his entire RSS feed is an excellent illustration of dragging dynamically-generated virtual content. (I didn't use an example like that because the purpose of the What a drag series was to get something done in the least amount...

CodeWhat a drag