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

reflection-property does not work for COM objects #4

Closed
Lovesan opened this issue Mar 7, 2020 · 1 comment
Closed

reflection-property does not work for COM objects #4

Lovesan opened this issue Mar 7, 2020 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@Lovesan
Copy link
Owner

Lovesan commented Mar 7, 2020

So currently one needs to manually invoke .Net reflection APIs if he wants to utilize COM, and especially, IDispatch-based interfaces.

E.g.https://gist.github.com/Lovesan/843a5daf6ff1564668c51f2a3886c8ea

The problem with reflection-property and its setf counterpart is that it checks for .Net property first, using Type.GetProperty and then utilizes property.GetValue instead of Type.InvokeMember, and the former does not work for COM objects.

The workaround would be to explicitly check whether an object type came from COM.

@Lovesan Lovesan added bug Something isn't working enhancement New feature or request labels Mar 7, 2020
@Lovesan
Copy link
Owner Author

Lovesan commented Mar 12, 2020

Fixed in 0.10.0: 831bdd5

@Lovesan Lovesan closed this as completed Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant