title: How to access functions of a class inside a dll using Java (JNA)
body: <p>I am trying to use several functions of class CashDrawer (<a href="https://docs.microsoft.com/en-us/uwp/api/Windows.Devices.PointOfService.CashDrawer" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/uwp/api/Windows.Devices.PointOfService.CashDrawer</a>) that are inside a windows dll called <strong>Windows.Devices.PointOfService.dll</strong> through Java using JNA, samples are provided here : <a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CashDrawer" rel="nofollow noreferrer">https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CashDrawer</a></p>
  
  <p>I tried a simple helloworld using JNA calling <strong>msvcrt.dll</strong> but here and in all examples I found the function used is directly inside the dll.
  My problem is that I don't know how to access the functions of CashDrawer in Windows.Devices.PointOfService.</p>
  
  <p>Easy example :</p>
  
  <pre><code>public interface JNAApiInterface extends Library {
      JNAApiInterface INSTANCE = (JNAApiInterface) Native.loadLibrary("msvcrt", JNAApiInterface.class);
  
      void printf(String format, Object... args);
  }
  
  public static void main(String args[]) {
      JNAApiInterface instance = JNAApiInterface.INSTANCE;
      instance.printf("coucou");
  }
  </code></pre>
  
  <p>I would like to open a CashDrawer, for the moment I only can do this :</p>
  
  <pre><code>public interface JNAApiInterface extends Library {
      JNAApiInterface INSTANCE = (JNAApiInterface) Native.loadLibrary("Windows.Devices.PointOfService", JNAApiInterface.class);
  
      // ???
  }
  
  public static void main(String args[]) {
      JNAApiInterface instance = JNAApiInterface.INSTANCE;
      // ???
  }
  </code></pre>
  
  <p>Other option that I didn't succeed would be to generate Java interface for <strong>Windows.Devices.PointOfService.dll</strong> using JNAerator but I don't know how to do that.</p>