Closed jaimecbernardo closed 5 months ago
This may be a change in C++/ADL rules/compliance. If you add using namespace winrt;
it works.
If that's not suitable, you can use co_await winrt::resume_foreground(queue);
explicitly.
cc @robmikh
Ah, thanks! I used the wil version in the past as a substitute, good to know it's still there in C++/WinRT. At some point I need to update those headers, but I've been spending most of my free time using Rust.
Worth pointing out that the wil version has some extra fixes that the cppwinrt one doesn't, as well as being the only one that works on WinUI 3.
but I've been spending most of my free time using Rust
Don't look back. 😏
Thank you. 😄 Ended up going with the same workaround as @robmikh : https://github.com/robmikh/Win32CaptureSample/commit/fc758e343ca886795b05af5003d9a3bb85ff4da2
Version
2.0.240111.5
Summary
After updating CppWinRT from 2.0.221104.6, which build this code, to 2.0.221117.1 or later, this code no longer builds.
I've uploaded a repository to make this easier to try to build and fail. https://github.com/jaimecbernardo/Sample-CppWinRT-DispatcherQueue-build-regression
The code is taken from https://www.nuget.org/packages/robmikh.common/0.0.22-beta package, from this file: https://github.com/robmikh/robmikh.common/blob/aaa31a1bcd4fac19ce4c544d2cfd415612add7f0/robmikh.common/include/robmikh.common/dispatcherqueue.desktop.interop.h
CppWinRT 2.0.221104.6 builds this code. This repo can be built at this commit: https://github.com/jaimecbernardo/Sample-CppWinRT-DispatcherQueue-build-regression/commit/c1a7221f9eeb6dab8a16fa6b812d97eb5132902c
The next version available (2.0.221117.1) https://github.com/jaimecbernardo/Sample-CppWinRT-DispatcherQueue-build-regression/commit/7742b755e2c4c6dd9293c85bdcc2cf8dfd543c8b , and the lastest (2.0.221104.6) https://github.com/jaimecbernardo/Sample-CppWinRT-DispatcherQueue-build-regression/commit/c1a7221f9eeb6dab8a16fa6b812d97eb5132902c , no longer allow build this repository.
Reproducible example
Expected behavior
The code should be able to build successfully.
Actual behavior
Additional comments
No response