Making an agile version of a Windows Runtime delegate in C++/WinRT, part 10
Permanent link:
cppdashboard.dev/r/2026/08/making-an-agile-version-of-a-windows-runtime-delegate-in-cppThis article discusses the challenges and considerations when implementing agile delegates in C++/WinRT, particularly focusing on the behavior of ContextCallback in COM and its implications for error handling and reentrancy.
From the article
In part 5 of this unnecessarily long series on agile delegates , commenter LB asked , “Is the ContextCallback in the deleter guaranteed to always succeed? According to the docs it can fail. I wonder if there’s a way to move the fallible part to an earlier point so the deleter can be infallible.”
Let’s look at the first part: What if IContextCallback:: ContextCallback fails?
If it fails, it means that COM couldn’t switch to the destination context.
Share this resource