Skip to content

Simple fix to also support .ocx files #1097

@dmigowski

Description

@dmigowski

I need to work with the Microsoft HTML Help API, which comes as hhctrl.ocx and can be used like a DLL.

To make this work, I had to change the NativeLibrary.java.

Please add the check for .oxc file extension to com.sun.jna.NativeLibrary.mapSharedLibraryName(String libName):

I replaced:

    else if (Platform.isWindows()) {
        if (libName.endsWith(".drv") || libName.endsWith(".dll") ) {
            return libName;
        }
    }

with

    else if (Platform.isWindows()) {
        if (libName.endsWith(".drv") || libName.endsWith(".dll") || libName.endsWith(".ocx")) {
            return libName;
        }
    }

and stuff works now. Please change this in your repository, many thanks.

I am using:
jna-5.2.0 on Win 10 with Oracle JDK 1.8

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