Showing archive results for 2011

Jul 5, 2011
Post comments count0
Post likes count1

Microspeak: Reporting through

Raymond Chen
Raymond Chen

I'll start with the citation from a hypothetical conversation: "This is being handled by Jonathan Swift." — Who does he report through? "He reports up through Jane Austen's org." The Microspeak term report through (or report up through) comes up often in situations where people from different groups are working together. In its most ...

OtherMicrospeak
Jul 4, 2011
Post comments count0
Post likes count1

A handful of trips through the time machine

Raymond Chen
Raymond Chen

A few trips through the time machine: In the Internet Explorer time machine video, I was struck by the remark, "Appearance-wise, very little had changed [in Internet Explorer 4] since IE3. Not much changed in terms of functionality, either." In fact, Internet Explorer 4 was probably the most significant revision of Internet Explorer in its ...

History
Jul 1, 2011
Post comments count0
Post likes count1

The list of heaps returned by GetProcessHeaps is valid when it returns, but who knows what happens later

Raymond Chen
Raymond Chen

A customer had a problem involving heap corruption. In our code, we call and then for each heap, we call to enable the low fragmentation heap. However, the application crashes due to an invalid heap handle. My question is, why do we need to allocate an array of size 1025 even though we pass 1024 to ? Ha, faked you out with that question...

Code
Jun 30, 2011
Post comments count0
Post likes count1

2011 mid-year link clearance

Raymond Chen
Raymond Chen

Another round of the semi-annual link clearance. And, as always, the obligatory plug for my column in TechNet Magazine:

Other
Jun 30, 2011
Post comments count0
Post likes count1

The UseUrl attribute in the App Paths key indicates that your application can accept a URL on the command line

Raymond Chen
Raymond Chen

Setting the attribute in your key indicates that your application can accept a URL on the command line as the document to be opened. The documentation for this attribute is a confusing blend of raw documentation, guidance, history, and an example. Let's tease the parts apart so you won't confuse the example with the contract. The raw documentat...

Code
Jun 29, 2011
Post comments count0
Post likes count1

What happens to WPARAM, LPARAM, and LRESULT when they travel between 32-bit and 64-bit windows?

Raymond Chen
Raymond Chen

The integral types , , and are 32 bits wide on 32-bit systems and 64 bits wide on 64-bit systems. What happens when a 32-bit process sends a message to a 64-bit window or vice versa? There's really only one choice when converting a 64-bit value to a 32-bit value: Truncation. When a 64-bit process sends a message to a 32-bit window, the 64-bit ...

Code
Jun 28, 2011
Post comments count0
Post likes count0

A different way to win from one of those claw game

Raymond Chen
Raymond Chen

I know two people (siblings) who are experts at those claw games. They can look at a claw game, assess the situation, decide whether there is a winnable toy, and if so, drop in their quarter and grab it. I asked the elder sibling how they arrived at this amazing skill. "As a teenager, I spent something like $20 pumping quarters into one of these m...

Non-Computer
Jun 28, 2011
Post comments count0
Post likes count1

How do I display the Find Printers dialog programmatically?

Raymond Chen
Raymond Chen

A customer wanted to display the Find Printers dialog programmatically to let the user pick a printer from Active Directory and wanted to know whether this was possible. Yes, it's possible, and there's more than one way to do it. There's the lazy way and the overachieving way. The overachieving way is to use the method. The sample function spe...

Code
Jun 27, 2011
Post comments count0
Post likes count1

There's more to workflow than hitting F5 in the IDE

Raymond Chen
Raymond Chen

Commenter Stu suggested that instead of having code to auto-correct dialog templates, why not have a program that corrects them at build time? That way, Windows wouldn't have to make all these accommodations for programs that didn't understand the new dialog template requirements for property sheet pages. For one thing, this model assumes that al...

Other
Jun 24, 2011
Post comments count0
Post likes count1

Why doesn't my MessageBox wrap at the right location?

Raymond Chen
Raymond Chen

A customer reported that the function was wrapping text "at the wrong location." Our program displays a message with the function, and we use the '\n' character to force line breaks at positions we choose. But we've found that starting in Windows Vista, the line breaks we placed are not working. The function is inserting its own line break...

Code