The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Jan 30, 2026
Post comments count
0
Post likes count
1
Why not store the SAFEARRAY reference count as a hidden allocation next to the SAFEARRAY?
The case of "Bring your own <CODE>SAFEARRAY</CODE>."
Jan 29, 2026
Post comments count
0
Post likes count
2
How can I retain access to the data in a SAFEARRAY after my method returns?
Find a way to take ownership.
Jan 28, 2026
Post comments count
0
Post likes count
1
Why did I lose the data even though I called SafeArrayAddRef?
You have to use the original pointer, but even that won't be good enough.
Jan 27, 2026
Post comments count
2
Post likes count
2
A digression on the design and implementation of SafeArrayAddRef and extending APIs in general
The concerns when adding a feature to an existing API.
Jan 26, 2026
Post comments count
0
Post likes count
3
What’s the difference between SafeArrayAccessData and SafeArrayAddRef?
Two ways of preserving the data.
Jan 23, 2026
Post comments count
15
Post likes count
4
C++ has scope_exit for running code at scope exit. C# says “We have scope_exit at home.”
You can wrap it in an <CODE>IDisposable</CODE>.
Jan 22, 2026
Post comments count
6
Post likes count
3
A simple helper function for attaching a progress handler to a Windows Runtime IAsyncActionWithProgress or IAsyncOperationWithProgress
It doesn't do much, but it saves typing.
Jan 21, 2026
Post comments count
2
Post likes count
2
On the proper usage of a custom Win32 dialog class
You are replacing the window procedure, not the dialog procedure.
Jan 20, 2026
Post comments count
5
Post likes count
2
Microspeak: On fire, putting out fires
Dealing with emergencies.

