stop an dll while executing a dll function

Hi,

i use jawin to run a dll which creates xml-files. In some cases i have to stop the creation of the xml-files. But there is no way to stop the invoked function of the dll. The sourcecode of the dll is not available . But i assume that the called function is a "normal" method without threads.

I tried to close the dispatchpointers from jawin, but that crashes the jvm.

Or i tried to set the objects to null -> but the creation of the xml-files continues.

Any ideas?

[503 byte] By [wildtriggera] at [2007-11-27 8:57:46]
# 1
Do the function call in a separate thread and interrupt this thread to stop the call.
vitallisa at 2007-7-12 21:22:46 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

yes this was my idea too. But when the function is once started it can't be stopped. I also test the advice to create a seperate thread for the function call(in the dllExcuter class). But this does'nt work.

// the main class which calls dllExecuter class(Thread)

dllExec = new DLLExecuter();

Thread currentThread = new Thread(dllExec);

currentThread.start();

//run xml generation until the loop is over

for (int i=0;i<1000000;i++)

{

System.out.println("loop "+i);

}

currentThread.interrupt();

wildtriggera at 2007-7-12 21:22:46 > top of Java-index,Java HotSpot Virtual Machine,Specifications...