Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dll function and return values

843829Jun 7 2003 — edited Jun 9 2003
Hi...

I am not very familiar with c++ but I need to write a small Wrapperclass in C/C++ and converting it to a dll that accesses another dll.
Okay the wrapper works in the way I can access it via JNI.
But now I do not know how to acces the other dll. I need to call some functions that also return values. Here is what I found out, but that does not work:
JNIEXPORT jstring JNICALL Java_ETechnik_LpaIS_nativeCallGoal
  (JNIEnv * env, jobject obj, jint value)
{
     FARPROC libFunc;
     int libFuncReturn;
     jstring jstr;
     HINSTANCE lib=LoadLibrary("Int386w.dll");
     if(lib!=NULL)
     {
          libFunc = (FARPROC)GetProcAddress(lib, "nativeCallGoal");
          if(libFunc!=NULL)
          {
               libFuncReturn=libFunc(value);           
          }
     }
     return jstr;
}
I need to return a jstring but I do not know how to acces the return of "libFunc". I think FARPROC is not the correct type.

Any help would be nice.

:)
Tweety
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 7 2003
Added on Jun 7 2003
7 comments
520 views