Showing tag results for Code

Jan 9, 2007
Post comments count0
Post likes count0

What triggers the recall of an offline file?

Raymond Chen
Raymond Chen

Hierarchical storage management is one of the taxes software developers have to pay. What can you safely do to an offline file? What will trigger its recall? (First, a note on terminology: Recalling a file means to restore it from remote storage to local storage. A file that has been recalled is online; a file that has been placed on remote stora...

Code
Jan 5, 2007
Post comments count0
Post likes count0

What('s) a character!

Raymond Chen
Raymond Chen

Norman Diamond seems to have made a side career of harping on this topic on a fairly regular basis, although he never comes out and says that this is what he's complaining about. He just assumes everybody knows. (This usually leads to confusion, as you can see from the follow-ups.) Back in the ANSI days, terminology was simpler. Windows opera...

Code
Jan 2, 2007
Post comments count0
Post likes count0

Why can't I GetProcAddress for CreateWindow?

Raymond Chen
Raymond Chen

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

Code
Dec 26, 2006
Post comments count0
Post likes count0

The first parameter to VerQueryValue really must be a buffer you obtained from GetFileVersionInfo

Raymond Chen
Raymond Chen

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 fir...

Code
Dec 18, 2006
Post comments count0
Post likes count0

Some call it context, others call it reference data, but whatever it is, it's yours

Raymond Chen
Raymond Chen

Different functions call it different things. calls it . calls it reference data. calls it . just calls it a parameter! But whatever its name is, it means the same thing: It's a value the function doesn't care about. All the function does is hand that value back to you. What the value means is up to you. What if you need to pass more context ...

Code
Dec 18, 2006
Post comments count0
Post likes count0

Do not write in-process shell extensions in managed code

Raymond Chen
Raymond Chen

Jesse Kaplan, one of the CLR program managers, explains why you shouldn't write in-process shell extensions in managed code. The short version is that doing so introduces a CLR version dependency which may conflict with the CLR version expected by the host process. Remember that shell extensions are injected into all processes that use the shell ...

Code
Dec 14, 2006
Post comments count0
Post likes count0

Computing listview infotips in the background

Raymond Chen
Raymond Chen

When the listview control asks you for an infotip, it sends you then notification, and when you return, the result is displayed as the infotip. But what if computing the infotip takes a long time? You don't want to stall the UI thread on a long operation, after all. This is where comes in. If you want to say, "Um, I'm not ready with that infot...

Code
Dec 13, 2006
Post comments count0
Post likes count0

Displaying infotips for folded and unfolded listview items

Raymond Chen
Raymond Chen

When displaying infotips for listview items, you have to deal with both the folded and unfolded case. "Folded" is the term used to describe a listview item in large icon mode whose text has been truncated due to length. When the user selects the item, the full text is revealed, a process known as "unfolding". Take our scratch program and make t...

Code