Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:13:33+00:00 2026-05-29T05:13:33+00:00

Edited Question: Trying to use a .dll file from Java using JNA. I’ve managed

  • 0

Edited Question:

Trying to use a .dll file from Java using JNA. I’ve managed to:

Add the .dll to the System Library – System.loadLibrary(“NativeLibrary”);

Created a a NativeInterface to map the functions in the .dll/.h file:

public interface NativeInterface extends Library, StdCallLibrary {
        public int methodA(packageURL.NativeInterface.typeDefName n);
        public int methodB();

        public static class typeDefName implements Structure.ByReference{

            public typeDefName(short s) {}  
    }
}

Added the mapping to my function name because its name in the .dll is “mangled” – Found this out using Dependency Walker

        Map options = new HashMap();
    options.
        put(
            Library.OPTION_FUNCTION_MAPPER, 
            new Mapper() {
                public String getFunctionName(NativeLibrary library, Method method) {
                    return super.getFunctionName(library, method);
                }
            }
        );

AND:

class Mapper implements FunctionMapper{
    public String getFunctionName(NativeLibrary library, Method method) {
       return "?" + method.getName() + "@@YAHPAEIPAPAXFPAUtypeDefName@@@Z";
    }

}

Now (What I’m not sure of) Is how to create an Object of typeDefName to pass into Method A

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:13:35+00:00Added an answer on May 29, 2026 at 5:13 am

    If your goal is just to use an existing DLL from Java, you can use JNA
    without doing any native programming at all. JNA accesses the methods of third-party shared libraries dynamically. You could use the library directly or use JNA to write a convenient wrapper entirely in Java.

    When you click the link, be sure to scroll down — there’s lots of documentation and stuff, but the top of the page is consumed by a file listing so it doesn’t look very useful until you scroll down.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edited Question: This should be clear. using System; namespace UpdateDateTimeFields { class Program {
I'm trying to reutilize code that generates FILE fields for use when something is
I'm trying to understand js module patterns in use with jQuery. I've edited this
EDITED because question is about same program. I'm trying to take the top fifty
I am trying to use quickSearch from http://lomalogue.com/jquery/quicksearch/ website. I don't know how to
Edited question to make it a bit more specific. Not trying to base it
I edited the question after David Hanak's answer (thanks btw!). He helped with the
I edited the question so it would make more sense. I have a function
I edited this question after i found a solution... i need to understand why
Warning: This question has been heavily edited. I tried my best to guess the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.