DLL jni Java6 update 1

Christoph christoph at singewald.at
Thu Mar 13 05:35:48 PDT 2008


Hi All!

Ich have a problem with jni and Java6 update 1. 
I have follwing files

my.dll  (DMD, bud)
myjni.dll (SWIGm, dmc or bcc32) references my.dll

When I am using Java5 everthing runs fine.
Ich I use Java6 I get an access violation and the end of the app, I think when it happens when java is unloding the dll. I tested it with a plain dll without gc and any other D function:

--DLL

import std.c.windows.windows;
HINSTANCE g_hInst;

extern(C) export int getX() {
        return 1;
}


extern (Windows) 
    BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved) {
   switch (ulReason) {
	    case DLL_THREAD_ATTACH:
	    case DLL_THREAD_DETACH:
	        return false;
    }
    g_hInst=hInstance;
    return true;
   
}

If I use a c++ dll created with bcc32/dmc everthing  runs fine with Java6.

thank you for helping 
christoph





More information about the Digitalmars-d-learn mailing list