Jump to content
Excelsior Forums

JimA

Members
  • Content count

    0
  • Joined

  • Last visited

    Never

Everything posted by JimA

  1. Call Jet DLL From C++

    I am trying to call a DLL created with Jet from a C++ program. I am using Microsoft Visual Studio 2003. When I try to compile the sample C code provided by Jet, I get the error 'JNIEnv_' does not have an overloaded member 'operator ->'
  2. Call Jet DLL From C++

    I had removed the return from the statement before when testing. With this change, it still does not find the class. Do you have a sample that is written in C++?
  3. Call Jet DLL From C++

    It isn't one of the samples. The code that I am using is string DllName = "c:\\TestData\\SECURITY_MASTER\\SecurityMaster.dll"; HMODULE dllClassHandle = LoadLibrary(DllName.c_str()); if (!dllClassHandle) { cout << "couldn't load dll."; return(-1); } int code; JavaVMInitArgs args; jint result; jint (JNICALL * JNI_GetDefaultJavaVMInitArgs_func) (void *args); jint (JNICALL * JNI_CreateJavaVM_func) (JavaVM **pvm, void **penv, void *args); JNI_GetDefaultJavaVMInitArgs_func = (jint (JNICALL *) (void *args)) GetProcAddress (dllClassHandle, "JNI_GetDefaultJavaVMInitArgs"); JNI_CreateJavaVM_func = (jint (JNICALL *) (JavaVM **pvm, void **penv, void *args)) GetProcAddress (dllClassHandle, "JNI_CreateJavaVM"); memset(&args, 0, sizeof(args)); args.version = JNI_VERSION_1_2; if (!JNI_GetDefaultJavaVMInitArgs_func) { cout << "JNI_GetDefaultJavaVMInitArgs not found."; return(-2); } result = JNI_GetDefaultJavaVMInitArgs_func(&args); if (result != JNI_OK) { cout << "JNI init failed code = " << result; return(-3); } JNIEnv *env; JavaVM *jvm; code = JNI_CreateJavaVM_func(&jvm, (void **)&env, &args); if (!code) { cout << "Create VM Function failed"; return(-4); } jclass dllClass = env->FindClass("SecurityMaster"); if(!dllClass) { cout << "Class not found"; }
  4. Call Jet DLL From C++

    That will compile, but it does not find the class in the DLL.
×