The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Jan 25, 2024
Post comments count 8
Post likes count 1

How can I give away a COM reference just before my object destructs?

Raymond Chen

You have to do it before committing to destruction.

Jan 24, 2024
Post comments count 2
Post likes count 2

The dangerous implementations of the IMemory­Buffer­Reference.Closed event

Raymond Chen

Mistakenly handing out COM references that don't work.

Jan 23, 2024
Post comments count 1
Post likes count 2

The useless IMemory­Buffer­Reference.Closed event

Raymond Chen

It tells you that you have already lost.

Jan 22, 2024
Post comments count 0
Post likes count 3

Accessing a block of memory represented by a Windows Runtime IMemoryBuffer

Raymond Chen

Through the currency known as an IMemoryBufferReference.

Jan 19, 2024
Post comments count 2
Post likes count 1

The case of the fail-fast trying to log a caught exception

Raymond Chen

What is being thrown and why can't we log it?

Jan 18, 2024
Post comments count 0
Post likes count 2

Implementing two-phase initialization with ATL

Raymond Chen

ATL looks like it supports two-phase initialization, but it doesn't.

Jan 17, 2024
Post comments count 1
Post likes count 2

Getting a strong reference from the this pointer too soon

Raymond Chen

Giving out strong references to an object before you can guarantee that it will work.

Jan 16, 2024
Post comments count 4
Post likes count 9

What is a hard error, and what makes it harder than an easy error?

Raymond Chen

A throwback to the early days of 16-bit Windows.

Jan 15, 2024
Post comments count 5
Post likes count 2

C++/WinRT gotcha: Not all exceptions derive from hresult_error

Raymond Chen

There are also C++ standard exceptions, particularly <CODE>std::bad_alloc</CODE>.