Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveXImpl.QuickActivate has a dependency on COM interop IConnectionPointContainer #9633

Open
JeremyKuhne opened this issue Aug 1, 2023 · 3 comments

Comments

@JeremyKuhne
Copy link
Member

JeremyKuhne commented Aug 1, 2023

The code here leverages the auto-generated IConnectionPointContainer from COM interop for access to managed events. If built-in COM interop is not available we'll have to figure how to replace this.

In this particular case it is only done for user controls, but we probably will need to provide this functionality in general for Control. I'm not sure how prevalent this is for our users that would want to use AOT.

cc: @AaronRobinsonMSFT @lonitra

@AaronRobinsonMSFT
Copy link
Member

The code here leverages the auto-generated IConnectionPointContainer from COM interop. If built-in COM interop is not available we'll have to figure how to replace this.

The IConnectionPointContainer interface is tough in general. I do think the mechanics of COM events in .NET are hidden and often crop up in places that aren't always obvious. I agree this is something the Interop team will need to consider how to address this, particularly when we start rewriting TlbImp to support .NET Core and COM source generators.

/cc @dotnet/interop-contrib

@JeremyKuhne
Copy link
Member Author

JeremyKuhne commented Aug 2, 2023

particularly when we start rewriting TlbImp to support .NET Core and COM source generators.

@AaronRobinsonMSFT this is of particular interest to us for the ActiveX Control scenario. We might also need to update the tool that generates the AxHost implementations on top of these.

cc: @Shyam-Gupta

@weltkante
Copy link
Contributor

weltkante commented Jan 4, 2024

I'm currently doing handwritten bindings (#10583) and noticed ConnectionPointCookie (which is related to the interface mentioned here) does not support COM source generators all, something is broken in the implementation here. When I pass an object implementing both a source generated and classic version of the same IDispatch interface ConnectionPointCookie rejects to connect.

Going forward, I think the main question for these event interfaces will be where the IDispatch support will live

  • will it be provided by source generators on the class implementing the IDispatch interface?
  • will WinForms provide some bridging?
  • does the user have to implement IDispatch himself to support custom ActiveX event interfaces?

@JeremyKuhne JeremyKuhne modified the milestones: .NET 9.0, Future Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

4 participants