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

  • SEARCH
  • Home
  • 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 7185357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:23:51+00:00 2026-05-28T18:23:51+00:00

I created a Java code that tries to access the method LoadProject of the

  • 0

I created a Java code that tries to access the method LoadProject of the class IProjectFactory defined in myAPI.dll. The description of the DLL file says: IProjectFactory is used to load a project file into memory. IProjectFactory is a static class in the myAPI.dll assembly. It exposes the LoadProject method that takes a string containing the path to the file to load, and returns a reference to the resulting IProject. Using the IProject interface you can then manipulate the loaded project in various ways.

import com.sun.jna.Library;
import com.sun.jna.Native;

public class MyClass {

public interface IProjectFactory extends Library {
    public Object LoadProject(String fileName);
}

public MyClass() {
    //System.loadLibrary("myAPI");
    load();
}

void load() {
    String fileName = "xxx.sp";
    IProjectFactory api = (IProjectFactory) Native.loadLibrary("myAPI",IProjectFactory.class);

    try {
        Object project = api.LoadProject(fileName);
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}

}

After running this code, the following error message has been generated:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Error looking up function 'LoadProject': The specified procedure could not be found.

    at com.sun.jna.Function.<init>(Function.java:179)
    at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:350)
    at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:330)
    at com.sun.jna.Library$Handler.invoke(Library.java:203)
    at $Proxy0.LoadProject(Unknown Source)

Does it mean that myAPI does not contain the class IProjectFactory with the method LoadProject?

  • 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-28T18:23:52+00:00Added an answer on May 28, 2026 at 6:23 pm

    You can call functions in native libraries with JNI or JNA. Primitive types are mapped. Certain structures are possible also. Even callback functions are possible. See JNA’s mapping table.

    What is impossible, by design: Getting a class or interface that was designed for a different runtime environment (like CLR) and use it seamless within the JVM.

    So if you have a native procedural/functional library that just returns pointers or primitive types then you can use it quite well.

    If you need to work with objects that are returned then you are out of luck. You need to run them in their native environment and find some way of interprocess communication.

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

Sidebar

Related Questions

I have a method that contains the following (Java) code: doSomeThings(); doSomeOtherThings(); doSomeThings() creates
I've created a Java class that connects to an IIS website requiring NTLM authentication.
does any knows how to access .jar file in JS. I have created class
I'd like to write some (java) code that takes a PDF document, and creates
I have existing java code and need to create Design Document based on that.
Have you ever created or encountered a self modifying code in Java? If yes,
I have created a java application for Debian Linux. Now I want that that
I have created a java application and packed it into a jar file on
when i try to animate custom View (created in java code), there is no
I have (java) code that creates and populates tables in a derby database, using

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.