-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-System.Runtime.InteropServicesin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Placing GeneratedComClass on a base class doesn't enable deriving types to work with source generated COM.
Should we check for base classes that have the IComExposedDetails as well here?
https://github.com/dotnet/runtime/blob/df6fdefa27068126794b253d4d822706221a92db/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/IComExposedDetails.cs#L21C49-L21C49
[GeneratedComInterface]
[Guid("c5356681-8f8c-423a-959c-2d91f17215d3")]
internal partial interface IFoo
{
int get();
}
[GeneratedComClass]
[Guid("9f826481-4d92-4499-ab26-c40d9f77435b")]
internal partial class FooBase : IFoo
{
public int get() => 42;
}
internal class Foo<T> :FooBase
{
}
int Main()
{
var cw = new StrategyBasedComWrappers();
var foo = new Foo<int>();
nint iptr = cw.GetOrCreateComInterfaceForObject(foo, CreateComInterfaceFlags.None);
IFoo f = (IFoo)cw.GetOrCreateObjectForComInstance(iptr, CreateObjectFlags.None); // Fails - iptr does not implement IFoo
}
Metadata
Metadata
Assignees
Labels
area-System.Runtime.InteropServicesin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Type
Projects
Status
No status