The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

The dangerous implementations of the <CODE>IMemory­Buffer­Reference.Closed</CODE> event
Jan 24, 2024
Post comments count 2
Post likes count 1

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

Raymond Chen
Raymond Chen

Mistakenly handing out COM references that don't work.

The useless <CODE>IMemory­Buffer­Reference.Closed</CODE> event
Jan 23, 2024
Post comments count 1
Post likes count 1

The useless IMemory­Buffer­Reference.Closed event

Raymond Chen
Raymond Chen

It tells you that you have already lost.

Accessing a block of memory represented by a Windows Runtime IMemoryBuffer
Jan 22, 2024
Post comments count 0
Post likes count 2

Accessing a block of memory represented by a Windows Runtime IMemoryBuffer

Raymond Chen
Raymond Chen

Through the currency known as an IMemoryBufferReference.

The case of the fail-fast trying to log a caught exception
Jan 19, 2024
Post comments count 2
Post likes count 0

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

Raymond Chen
Raymond Chen

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

Implementing two-phase initialization with ATL
Jan 18, 2024
Post comments count 0
Post likes count 1

Implementing two-phase initialization with ATL

Raymond Chen
Raymond Chen

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

Getting a strong reference from the <CODE>this</CODE> pointer too soon
Jan 17, 2024
Post comments count 1
Post likes count 1

Getting a strong reference from the this pointer too soon

Raymond Chen
Raymond Chen

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

What is a hard error, and what makes it harder than an easy error?
Jan 16, 2024
Post comments count 4
Post likes count 8

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

Raymond Chen
Raymond Chen

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

C++/WinRT gotcha: Not all exceptions derive from <CODE>hresult_error</CODE>
Jan 15, 2024
Post comments count 5
Post likes count 1

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

Raymond Chen
Raymond Chen

There are also C++ standard exceptions, particularly std::bad_alloc.

In C++/WinRT, how can I await multiple coroutines and capture the results?, part 3
Jan 12, 2024
Post comments count 1
Post likes count 1

In C++/WinRT, how can I await multiple coroutines and capture the results?, part 3

Raymond Chen
Raymond Chen

Dealing with awaitables that return void, and questioning our life choices.