-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure out async calls to WinRT #97
Comments
Here's a Go-based example from @mraleph: and more on the general issue: |
I don't know anything about Dart (yet) 😉 but am the creator of C++/WinRT and more recently started creating Rust/WinRT. A WinRT async method returns one of four async interfaces ( auto file = picker.PickSingleFileAsync().get(); And C++ coroutines are used for cooperatively waiting (without blocking calling thread): auto file = co_await picker.PickSingleFileAsync(); Happy to answer any questions you might have: kenny.kerr@microsoft.com |
I also wanted to know, how async callbacks work for flutter/dart (not necessarily in conjunction with WinRT though). I built a proof of concept here: https://github.com/ghost23/win32_midi If you're interested, the method in question there is Win32Midi.openMidiInput(...) in ./lib/win32_midi.dart Also important is the CallbackManager.h/cpp , which manages the port and the conversion of data from c++ to dart. |
@jhancock4d from flutter/flutter#64958 (comment) You could track the WinRT projection here |
As an example, this doesn't work yet:
https://github.com/timsneath/win32/blob/main/example/winrt_picker.dart#L20
FileOpenPicker is here:
https://github.com/timsneath/win32/blob/main/lib/src/com/IFileOpenPicker.dart
which is derived using the Windows Runtime metadata using my Dart-based parser (https://pub.dev/packages/winmd).
The original signature is here:
https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.fileopenpicker.picksinglefileasync?view=winrt-19041
The text was updated successfully, but these errors were encountered: