Skip to content

COMLateBindingObject.getBooleanProperty() uses wrong type?! #609

@SevenOf9Sleeper

Description

@SevenOf9Sleeper

Hi there,
I'm just on my way to program a COM type library generator to generate classes extending from COMLateBindingObject. That works quite good.
But when I have a boolean property like "Visible" in the _Application class from Word, then I get this exception, when I want to read the "Visible"-property:

Exception in thread "main" java.lang.ClassCastException: com.sun.jna.platform.win32.WinDef$BOOL cannot be cast to com.sun.jna.platform.win32.OaIdl$VARIANT_BOOL
at com.sun.jna.platform.win32.COM.COMLateBindingObject.getBooleanProperty(COMLateBindingObject.java:152)
at generated._Application.isVisible(_Application.java:29)
at de.sogrades.officeremote.OfficeTester.createWord(OfficeTester.java:58)
at de.sogrades.officeremote.OfficeTester.main(OfficeTester.java:27)

the _Application.isVisible-method looks like:
public boolean isVisible() { return super.getBooleanProperty("Visible"); }

Is this a problem of COMLateBindingObject? Or am I just missing a point?
Setting a boolean property with setProperty("Visible", booleanValue) is no problem.

Hope somebody can fix this...

With kind regards,
Siebenschläfer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions