title: Calling C++ dll from Java
body: <p>I'm using Java for a small app. It's a rewrite of an existing MFC project. There is an existing dll that I need to change to enable access from Java using JNI. All of this Java stuff is new to me, so I'm having a little trouble and feeling rather dense when I read other forum posts. In the existing dll I have a function like this:</p>
  
  <pre><code>extern "C" __declspec(dllexport) bool Create()
  {
       return TRUE;
  }
  </code></pre>
  
  <p>Dumb question time. How do I properly set it up to be called by Java? </p>
  
  <p>I tried this:</p>
  
  <pre><code>JNIEXPORT jboolean JNICALL Create()
  {
       return TRUE;
  }
  </code></pre>
  
  <p>I'm including jni.h and everything compiles fine. However, when I call it from Java I get UnsatisfiedLinkError. I'm calling it from Java using this:</p>
  
  <pre><code>public static native boolean CreateSession();
  
  System.load("D:\\JavaCallTest.dll");
  Create();
  </code></pre>
  
  <p>Could someone kindly push me in the proper direction? I sincerely appreciate any help.</p>
  
  <p>Thanks,</p>
  
  <p>Nick</p>