Version
2.0.220131.2
Summary
winrt::impl::get_runtime_activation_factory_impl does the following:
- If the DLL has set a handler callback, call it and return.
- Try to use Windows'
RoGetActivationFactory, if present, and the type's factory is available, return it.
- Do type-name based probing (
Contoso.Foo.Bar.dll, Contoso.Foo.dll, Contoso.dll) for DLLs and use those
Certain projects really only want items 1 & 2 above. Provide a control point for 3. Path based probing can induce surprise behavior when DLLs have overlapping names.
Reproducible example
No response
Expected behavior
No response
Actual behavior
No response
Additional comments
After talking with @oldnewthing , I suggest:
- Move the name-based probing to a new method, like
winrt::find_dll_factory
- Change
get_runtime_activation_factory_impl to use a callback pointer, like winrt_fallback_handler
- Document how to say
winrt_activation_handler = winrt::fallback_handler if your module needs fallback
This makes the default behavior "you have to get your stuff registered in a side-by-side or package manifest, or you have to be using a built-in or Windows type" with support for projects who prefer reg-free operation.
Version
2.0.220131.2
Summary
winrt::impl::get_runtime_activation_factory_impldoes the following:RoGetActivationFactory, if present, and the type's factory is available, return it.Contoso.Foo.Bar.dll,Contoso.Foo.dll,Contoso.dll) for DLLs and use thoseCertain projects really only want items 1 & 2 above. Provide a control point for 3. Path based probing can induce surprise behavior when DLLs have overlapping names.
Reproducible example
No response
Expected behavior
No response
Actual behavior
No response
Additional comments
After talking with @oldnewthing , I suggest:
winrt::find_dll_factoryget_runtime_activation_factory_implto use a callback pointer, likewinrt_fallback_handlerwinrt_activation_handler = winrt::fallback_handlerif your module needs fallbackThis makes the default behavior "you have to get your stuff registered in a side-by-side or package manifest, or you have to be using a built-in or Windows type" with support for projects who prefer reg-free operation.