Skip to content
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

Simple fix to also support .ocx files #1097

Closed
dmigowski opened this issue May 31, 2019 · 1 comment
Closed

Simple fix to also support .ocx files #1097

dmigowski opened this issue May 31, 2019 · 1 comment

Comments

@dmigowski
Copy link

dmigowski commented May 31, 2019

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

@matthiasblaesing
Copy link
Member

Change was merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants