This is confusing, but there is a difference between WinRT C ++ code and WRL. You can use WRL to directly access the ABI layer. WRL does not use exceptions, but loves patterns. Recommended coding style for WinRT does not match WRL.
I'm not sure everyone can do this, but with WRL you generally need to implement a class that inherits:
class CreateAysncOp: public RuntimeClass<IAsyncOperation<result_runtime_class*>,AsyncBase<IAsyncCompletedHandler<result_runtime_class*>> { ...
Then you can use
hr = MakeAndInitialize<CreateAsyncOp, IAsyncOperation<type_foo*>>(...);
source share