title: Code for running the method declared in DLL
body: <p>I created a Java code that tries to access the method <code>LoadProject</code> of the class <code>IProjectFactory</code> defined in <code>myAPI.dll</code>. The description of the DLL file says: <em>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.</em></p>
  
  <pre><code>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();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>After running this code, the following error message has been generated:</p>
  
  <pre><code>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.&lt;init&gt;(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)
  </code></pre>
  
  <p>Does it mean that <code>myAPI</code> does not contain the class IProjectFactory with the method <code>LoadProject</code>?</p>