Skip to content

Conversation

forderud
Copy link
Owner

@forderud forderud commented Jun 16, 2025

Underlying implementation: https://github.com/microsoft/wil/blob/master/include/wil/cppwinrt_register_com_server.h

PROBLEM: wil::register_com_server doesn't seem to pick up the COM class ID as intended. It instead detects the COM interface GUID when calling CoRegisterClassObject.

Upstream issue reports

COM class GUID implementation notes

namespace winrt::impl
    template <typename T>
    inline constexpr guid guid_v{ __uuidof(T) };

    template <typename T, typename = std::void_t<>>
    struct default_interface
    {
        using type = T;
    };
}

WINRT_EXPORT namespace winrt
{
    template <typename T>
    using default_interface = typename impl::default_interface<T>::type;

    template <typename T>
    constexpr guid const& guid_of() noexcept
    {
        return impl::guid_v<default_interface<T>>;
    }
}

@forderud forderud force-pushed the wil-CppWinRTClassFactory branch from 39258d1 to c7b8aab Compare June 16, 2025 10:47
@forderud forderud marked this pull request as draft June 16, 2025 10:55
@forderud forderud force-pushed the wil-CppWinRTClassFactory branch 9 times, most recently from 57ab6a9 to ae5827e Compare June 17, 2025 09:57
@forderud forderud force-pushed the wil-CppWinRTClassFactory branch from ae5827e to bfd8948 Compare June 17, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant