#undef WINAPI_FAMILY #define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
in the WinRT component, it worked correctly. The original setting was for UWP, but I want to use it with WinUI 3 in C#.