The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
How can I give away a COM reference just before my object destructs?
You have to do it before committing to destruction.
The dangerous implementations of the IMemoryBufferReference.Closed event
Mistakenly handing out COM references that don't work.
The useless IMemoryBufferReference.Closed event
It tells you that you have already lost.
Accessing a block of memory represented by a Windows Runtime IMemoryBuffer
Through the currency known as an IMemoryBufferReference.
The case of the fail-fast trying to log a caught exception
What is being thrown and why can't we log it?
Implementing two-phase initialization with ATL
ATL looks like it supports two-phase initialization, but it doesn't.
Getting a strong reference from the this pointer too soon
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?
A throwback to the early days of 16-bit Windows.
C++/WinRT gotcha: Not all exceptions derive from hresult_error
There are also C++ standard exceptions, particularly <CODE>std::bad_alloc</CODE>.