Skip to content

Consider implementing limited support for COM aggregation #3767

@kennykerr

Description

@kennykerr

I removed this support as it was only needed for Xaml and overly complicated for the vast majority of other cases but perhaps there is a simple way to support it in a limited fashion, most likely with a dedicated macro.

@kennykerr I appreciate your help with #3242 very much. I've mentioned the need for composable inheritance previously, or at least a way to hook into QI so that it was possible to implement it by hand without unrolling the implement macro. .NET has ICustomQueryInterface, something like this would've definitely been helpful even without proper composable support.

You can see the main perpetrator here:

If I want to use any XAML at all, even if it's in an "island", -- I must inherit from (I)Application because its factory turns it into a singleton reused later on. I don't like it either, but there's no way around it. I've tried implementing it with the "stock" implement macro, but it works until it doesn't, see this commit: Alovchin91/winui3-rs@83cb3eb

FYI, I have no plans to publish it, at least as a "winui3" crate, because I don't plan to support the entirety of the API surface (and WebView2 is not a part of my plans, at least currently). I'm only looking at a very constrained set of use cases, like a Window with a SwapChainPanel (because Window itself is not a UIElement, unfortunately).

Originally posted by @Alovchin91 in #3762

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions