-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Allow access to base interfaces via ProxyObject and improve binding #616
Merged
dblock
merged 3 commits into
java-native-access:master
from
matthiasblaesing:c.s.j.p.w.COM.util_access_IDispatch
Mar 26, 2016
Merged
Allow access to base interfaces via ProxyObject and improve binding #616
dblock
merged 3 commits into
java-native-access:master
from
matthiasblaesing:c.s.j.p.w.COM.util_access_IDispatch
Mar 26, 2016
Conversation
This file contains 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
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.
matthiasblaesing
force-pushed
the
c.s.j.p.w.COM.util_access_IDispatch
branch
from
March 11, 2016 20:50
1714d29
to
b57fe09
Compare
@@ -43,6 +43,7 @@ Features | |||
* [#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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing period at the end ;)
This looks ok to me, maybe @lgoldstein could help with a more thorough CR, I don't understand half the code ;) |
matthiasblaesing
force-pushed
the
c.s.j.p.w.COM.util_access_IDispatch
branch
from
March 25, 2016 22:14
b57fe09
to
a1bee93
Compare
The CHANGES.md entry was adjusted - is there any way I can help with review? |
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
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.