Closed amtopel closed 1 year ago
Can you share some code?
non_agile
just instructs the implements
class template not to implement the IAgileObject
and IMarshal
interfaces by default but does not have any control over whether the composed base type does so.
We cannot change the QueryInterface
implementation without wreaking havoc. 😊 The non_agile
marker is not saying that the object is never to be agile but rather that the implements
class template will not implement those two interfaces. This is typically used not to suppress agility but to allow someone to provide custom implementations of IMarshal
.
You may want to stick with ATL. 😊
Note that agility and thread-safety are not the same thing and the composition support in C++/WinRT is only there to support Xaml where you really can't mess with the agility or concurrency of the base type.
I've been trying to create single-threaded classes in C++/WinRT using
non_agile
, and based on some anecdotal testing, it seems thatnon_agile
works with classes that don't derive from a base class. But if a class does derive from a base class, then it doesn't work, and the class is agile.Is that accurate?
And if so, is there any way to make a derived class
non_agile
?Thanks for any assistance.