Allow access to base interfaces via ProxyObject and improve binding#616
Merged
dblock merged 3 commits intojava-native-access:masterfrom Mar 26, 2016
Conversation
Although the ProxyObject by definition exposes a IDispatch, the methods are not callable via the Proxy.
…etIDsOfNames) dispIDs can be queried via GetIDsOfNames at runtime or retrieved from the typelibrary when bindings are generated. Using the dispID eliminates one additional call into native environment. It was also observed, that runtime reflection sometimes retrieves wrong values (toString on IHTMLDocument2), so using a previously retrieved value seems to be saver.
1714d29 to
b57fe09
Compare
| * [#608](https://github.com/java-native-access/jna/pull/608): Mavenize the build process - change parent and native pom artifactId/name to differentiate in IDE and build tools. [@bhamail](https://github.com/bhamail) | ||
| * [#613](https://github.com/java-native-access/jna/pull/613): Make Win32Exception extend LastErrorException [@lgoldstein](https://github.com/lgoldstein). | ||
| * [#613](https://github.com/java-native-access/jna/pull/614): Added standard 'Kernel32Util#closeHandle' method that throws a Win32Exception if failed to close the handle [@lgoldstein](https://github.com/lgoldstein). | ||
| * [#616](https://github.com/java-native-access/jna/pull/616): Allow access to base interfaces (most important IDispatch) via ProxyObject and improve binding by allowing to use dispId for the call [@matthiasblaesing](https://github.com/matthiasblaesing) |
Member
|
This looks ok to me, maybe @lgoldstein could help with a more thorough CR, I don't understand half the code ;) |
b57fe09 to
a1bee93
Compare
Member
Author
|
The CHANGES.md entry was adjusted - is there any way I can help with review? |
Member
|
I'll mege. |
mstyura
pushed a commit
to mstyura/jna
that referenced
this pull request
Sep 9, 2024
Motivation: We should use the same order of method arguments to not introduce bugs later. Modifications: Change argument order to be consistent and fix a typo Result: Cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ProxyObject implements several base interfaces directly, but the methods were not correctly handled. This pull modifies the InvocationHandler part to select methods based on declaration interface with direct method invocation, instead of manually redirecting each method.
The second part adds more robustness (and speed as sideeffect) to ProxyObject by using dispIDs if they are available, making reflection via GetIDsByName unnessary.