-
Notifications
You must be signed in to change notification settings - Fork 235
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
Helpers for implementing Out Of Proc COM server in cppwinrt, without WRL #439
Labels
feature-request
New feature or request
Comments
roxk
added a commit
to roxk/wil
that referenced
this issue
Feb 20, 2024
3 tasks
roxk
added a commit
to roxk/wil
that referenced
this issue
Mar 9, 2024
dunhor
added a commit
that referenced
this issue
Mar 28, 2024
…y (without WRL) (#440) * Fix tests cmake not working with msvc + msbuild * Initial impl of #439 * Make com server test a separate executable * Fix not able to create non-projected implementation class * Add tests * Fix format * Fix cannot set notifier directly * Add test for defining module lock manually * Rename default class factory Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com> * Fix not using CppWinRTClassFactory elsewhere * Clear tokens after revoking * Make com_server_revoker non-copyable * Do not record defaulted registration token * Fix revoker not constructible * Remove C++17 guard * Handle server registration failure Align behavior with WRL. Specifically, failing any server registration undo all registrations. Fix revoke can throw, making dtor of com_server_revoker throw (which is bad) * Remove C++/17 guard in tests * De-templatize notifiable_module_lock Make CustomModuleLockTest test user using another lock type * Require user to define WINRT_CUSTOM_MODULE_LOCK Detect and warn users to include notifiable_module_lock _before_ including winrt headers * Fix format * Update include/wil/cppwinrt_notifiable_module_lock.h * Update include/wil/cppwinrt_register_com_server.h * Add cppwinrt-com-server* tests to runtests.cmd * Explain why push_back is safe * Use wil::unique_com_class_object_cookie as revoker * Ensure module lock's count is initialized Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com> * Remove redundant try-catch It was necessary, but now that we use wil's unique_com_class_cookie we no longer need to catch, clean up and re-throw * Try-catch CreateInstance winrt::hresult doesn't seem to be recognized so it's handled separately * Let wil handle winrt::hresult_error * Add test for register_com_server failure * Fix format * Make notifiable_module_lock singleton #439 * Update activation after module starts waiting test * Add notifiable_module_lock_base --------- Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context:
microsoft/cppwinrt#601
This comment summarize the request in a succinct way:
For brevity, here are the original requirement as described in the above thread:
As analyzed by kenny, (2) is already handled by cppwinrt. Some extra work is needed for (1) and (3).
I have created a sample repo that demonstrates that both (1) and (3) is possible with just cppwinrt, with the help of some small helpers:
You can read the sample repo for more details. In short, here is how it works:
This issue asks that these helpers be added to wil for mass adoption so that cppwinrt-only Out Of Proc COM server becomes a reality. Once these helpers get into wil,
IExplorerCommand
andIWidgetProvider
sample should be updated so that they are cppwinrt-only. Say goodbye to WRL for good.API Spec
Notifiable module lock
Object registration
Usage
Open Question
WINRT_CUSTOM_MODULE_LOCK
MACRO and actually defining the custom module lock inwinrt
namespace? I have tested this idea and found that wil needs to provide another API to configure the module lock's notifierThe text was updated successfully, but these errors were encountered: