Quantcast
Channel: The Old New Thing
Browsing all 3085 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Weak references have no effect on object lifetime

The Weak­Reference class lets you retain a reference to an object while still permitting the object to be garbage collected. When that happens, then the Is­Alive property is false and the Target...

View Article


Image may be NSFW.
Clik here to view.

The mathematical card game Krypto and reaching a level of proficiency where...

There is a mathematical card game known as Krypto. The rules are simple: Each card has a numeric value. Six cards are dealt face-up in the center of the table: One card is designated as the objective...

View Article


Image may be NSFW.
Clik here to view.

On partially-constructed objects, additional remarks, not as interesting

Don't worry. Our long national nightmare of CLR week is almost over. I had originally planned to write an article about partially-constructed objects, but in the time since I queued up the topic (back...

View Article

Image may be NSFW.
Clik here to view.

Why does the CLR report a NullReferenceException even if the referenced...

We saw some time ago that before invoking a method on an object, the CLR will generate a cmp [ecx], ecx instruction to force a null reference exception to be raised if you are trying to invoke a...

View Article

Image may be NSFW.
Clik here to view.

Each time I move, my mailbox moves further away

When I was growing up, the mailman letter carrier came right to our front door. The mailbox was mounted on the front of the house right next to the front door. You could check the mail without even...

View Article


Image may be NSFW.
Clik here to view.

How do I convert a synchronous file handle into an asynchronous one?

Say you opened a file in synchronous mode, and then you realize that you want to issue asynchronous I/O on it, too. One way to do this is to call Create­File a second time with the...

View Article

Image may be NSFW.
Clik here to view.

Please don't wade across the Strait of Juan de Fuca

I dreamed that I was visiting a scenic location near the Canadian border. A central large body of water had the mainland to the south and east. A river ran southeast, spanned by a footbridge. To the...

View Article

Image may be NSFW.
Clik here to view.

Generally speaking, yanking the power plug unexpectedly should not be part of...

A customer had a complex process for setting up their computers, and the process recorded information in the registry so that applications could record their state across reboots. They then noticed...

View Article


Image may be NSFW.
Clik here to view.

What's the point of letting you change the GCL_CBCLSEXTRA if it has no effect?

The documentation for the Set­Class­Long­Ptr function mentions GCL_CB­CLS­EXTRA: Sets the size, in bytes, of the extra memory associated with the class. Setting this value does not change the number...

View Article


Image may be NSFW.
Clik here to view.

How do I control the order of the pages in property sheets from my shell...

A customer wanted to know whether a shell extension can control the order of the property sheet pages in a property sheet. The IShell­Prop­Sheet­Ext interface lets you add pages and replace pages, but...

View Article

Image may be NSFW.
Clik here to view.

If I signal an auto-reset event and there is a thread waiting on it, is it...

Let's go straight to the question: I have two programs that take turns doing something. Right now, I manage the hand-off with two auto-reset events. In Thread A, after it finishes doing some work, it...

View Article

Image may be NSFW.
Clik here to view.

The tiny table sorter - or - you can write LINQ in JavaScript

I had a little side project that displayed status information in a table, and I figured, hey, let me add sorting. And it was a lot easier than I thought. I just put the header row in the THEAD and the...

View Article

Image may be NSFW.
Clik here to view.

A dream about forgetting to deploy the backup brake pads

I dreamed that that I was driving through a parking garage when my brakes suddenly failed. I tried executing turns to bleed off speed, but it was largely ineffective. I managed to avoid hitting a...

View Article


Image may be NSFW.
Clik here to view.

Microspeak: The train

Work on Windows occurs in several different branches of the source code, and changes in one branch propagate to other branches. The goal is to push changes toward the trunk on a regular cadence. I...

View Article

Image may be NSFW.
Clik here to view.

Adding a confirmation dialog to every drag/drop operation does not solve the...

A customer wanted to know how to enable a confirmation dialog whenever the user inadvertently perform a drag/drop operation in Explorer to move files within a volume. For example, if I have an S drive...

View Article


Image may be NSFW.
Clik here to view.

All I/O on a synchronous file handle is serialized; that's why it's called a...

File handles are synchronous by default. If you want asynchronous file handles, you need to pass the FILE_FLAG_OVERLAPPED flag when you create the handle. And all operations on a synchronous file...

View Article

Image may be NSFW.
Clik here to view.

If I attach a file to an existing completion port, do I have to close the...

There are two ways of calling the Create­IO­Completio­Port function. You can pass a null pointer as the Existing­Completion­Port parameter, indicating that you would like to create a brand new...

View Article


Image may be NSFW.
Clik here to view.

Why doesn't the "Automatically move pointer to the default button in a dialog...

The Mouse control panel has a setting called Automatically move pointer to the default button in a dialog box, known informally as Snap to default button or simply Snap To. You may have discovered...

View Article

Image may be NSFW.
Clik here to view.

The challenge of improvisational historical comedy

I dreamed that one of my friends signed me up for some sort of combination Punk'd/Thank God You're Here improv show without my knowledge, and I had to explain how her husband had unwittingly coined...

View Article

Image may be NSFW.
Clik here to view.

How can I find out which process and user is modifying a file?

When troubleshooting a problem, you may discover that a file is being modified that shouldn't, and you figure out would be nice if there were some way of finding out which process is modifying the...

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>