internal static T CreateInstance <T>(string fullName) where T : IUnknown { var s = WindowsCreateString(fullName); EnsureRoInitialized(); var pUnk = RoActivateInstance(s); using var unk = MicroComRuntime.CreateProxyFor <IUnknown>(pUnk, true); WindowsDeleteString(s); return(MicroComRuntime.QueryInterface <T>(unk)); }
internal static TFactory CreateActivationFactory <TFactory>(string fullName) where TFactory : IUnknown { var s = WindowsCreateString(fullName); EnsureRoInitialized(); var guid = MicroComRuntime.GetGuidFor(typeof(TFactory)); var pUnk = RoGetActivationFactory(s, ref guid); using var unk = MicroComRuntime.CreateProxyFor <IUnknown>(pUnk, true); WindowsDeleteString(s); return(MicroComRuntime.QueryInterface <TFactory>(unk)); }