Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `com.sun.jna.platform.win32.Win32Exception` extend `com.sun.jna.LastErrorException` - [@lgoldstein](https://github.com/lgoldstein).
* [#614](https://github.com/java-native-access/jna/pull/614): Added standard `com.sun.jna.platform.win32.Kernel32Util.closeHandle()` method that throws a `com.sun.jna.platform.win32.Win32Exception` if failed to close the handle - [@lgoldstein](https://github.com/lgoldstein).
* [#618](https://github.com/java-native-access/jna/pull/618): Implement SAFEARRAY access and bugfix VARIANT - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#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).
* [#621](https://github.com/java-native-access/jna/pull/621): Added TYPEFLAGS-constants for `wTypeFlags` in `com.sun.jna.platform.win32.OaIdl.TYPEATTR` - [@SevenOf9Sleeper](https://github.com/SevenOf9Sleeper).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected boolean getBooleanProperty(String propertyName) {
this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result,
this.getIDispatch(), propertyName);

return (((VARIANT_BOOL) result.getValue()).intValue() != 0);
return result.booleanValue();
}

/**
Expand Down Expand Up @@ -179,7 +179,7 @@ protected int getIntProperty(String propertyName) {
this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result,
this.getIDispatch(), propertyName);

return ((LONG) result.getValue()).intValue();
return result.intValue();
}

/**
Expand All @@ -194,7 +194,7 @@ protected short getShortProperty(String propertyName) {
this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result,
this.getIDispatch(), propertyName);

return ((SHORT) result.getValue()).shortValue();
return result.shortValue();
}

/**
Expand All @@ -209,7 +209,7 @@ protected String getStringProperty(String propertyName) {
this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result,
this.getIDispatch(), propertyName);

return result.getValue().toString();
return result.stringValue();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package com.sun.jna.platform.win32.COM.util;

import com.sun.jna.platform.win32.OaIdl.VARIANT_BOOL;
import com.sun.jna.platform.win32.OleAuto;
import com.sun.jna.platform.win32.Variant;
import java.lang.reflect.InvocationHandler;
Expand Down Expand Up @@ -100,6 +101,8 @@ public static Object toJavaObject(VARIANT value, Class targetClass) {
}
if (vobj instanceof WinDef.BOOL) {
return ((WinDef.BOOL) vobj).booleanValue();
} else if (vobj instanceof VARIANT_BOOL) {
return ((VARIANT_BOOL) vobj).booleanValue();
} else if (vobj instanceof WinDef.LONG) {
return ((WinDef.LONG) vobj).longValue();
} else if (vobj instanceof WinDef.SHORT) {
Expand Down
Loading