I want to call a 'C'api called BUICInit() in vendors dll from java using JNI.but the generated function name using
javah is java_classname_API().so I kept my own dll and from my dll i called vendors dll..
I used loadlibrary()/getprocaddress()..it is working but is there any possiblities with out using getprocaddress
this is my sample program which i used to call vendor dll from my dll..
#include <jni.h>
#include <stdio.h>
#include "HelloWorld.h"
#include<windows.h>
typedef int (*MYPROC)();
JNIEXPORT void JNICALL
Java_HelloWorld_print(JNIEnv *env, jobject obj)
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
printf("in the function");
hinstLib = LoadLibrary(TEXT("buicap32.dll"));
printf("in the function");
if (hinstLib != NULL)
{
printf("sucess");
ProcAdd = (MYPROC) GetProcAddress(hinstLib, "BUICInit");
printf("add2(3): %d",ProcAdd());
if (NULL != ProcAdd)
{
printf("fail");
}
// Free the DLL module.
}
}
thanks