Bonjour,

j'essaie d'appeler une dll depuis du code java:

Voici le code java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
public class MS2525bSymbolBuilder 
{
    static
    {
        System.loadLibrary("JNIRakuInteface");
    }
 
    public static native void createSymbol(String code_p, String filename_p);
 
}
Voici le code C:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
 
void initializeComAPI()
{
    if (!initialized)
    {
    	OleInitialize(NULL);
 
        // Create the RSS COM object and retrieve the default interface IID_IRSSComponent
		hr = CoCreateInstance(__uuidof(RSSCOMObject), NULL, CLSCTX_ALL, IID_IRSSComponent, (void**)&pIRSSComp);
        printf ("hr= %d, pIRSSComp= %d\n", hr, pIRSSComp); 
 
        if (hr != S_OK)
        {
            if (hr == REGDB_E_CLASSNOTREG)
            {
                printf ("A specified class is not registered in the registration database.\n"); 
            }
 
            else if (hr == CLASS_E_NOAGGREGATION)
            {
                printf ("This class cannot be created as part of an aggregate.\n"); 
            }
 
            else if (hr == E_NOINTERFACE)
            {
                printf ("The specified class does not implement the requested interface, or the controlling IUnknown does not expose the requested interface.\n"); 
            }
        }
 
        else
        {
        }
    	// Query for the ConnectionPointContainer 
		//hr = pIRSSComp->QueryInterface(IID_IConnectionPointContainer,(LPVOID FAR*)&lpCPC);
 
	    // Find the event and advise	
		//hr = lpCPC->FindConnectionPoint(DIID__IRSSComponentEvents,&lpCPT);
		//hr = lpCPT->Advise(&g_RSSEventDispatch,&dwEventCookie);
		//SafeRelease(lpCPC);
    }
}
 
JNIEXPORT void JNICALL Java_commons_symbology2525b_MS2525bSymbolBuilder_createSymbol
(
    JNIEnv * env_p,
    jclass class_p,
    jstring code_p,
    jstring destFilename_p)
{
    if (!initialized)
    {
        initializeComAPI();
    }
 
}

Mon problème est le suivant:
Avec les jdk1.5 et 1.6 lorsque je lance le programme java avec l'option -Xmx1024m la methode CoCreateInstance me retourne l'erreur REGDB_E_CLASSNOTREG alors qu'avec la jdk 1.4 cela marche bien.

Quelqu'un a une idée ?