We’ve got an Applet that makes a JNI call to a DLL. Been working happily on several hundred Windows NT (don’t ask) boxes out there for some time. Good good. Then we start testing against XP… and the core dumps begin…

I’ve been using debug mode in VC++ and stepping through the whole call trace. All good. Then I build a Release version of the DLL. Unlucky - crashes IE straight away. So I inserted a stack of OutputDebugString() in the DLL to see where it fails… and it fails in different locations on different invocations.. and sometimes it doesn’t fail at all.

So I linked against a static version of the C Runtime instead of a shared DLL version. No problems. Buggered if I know what the problem is. I know there are problems when you new() with one version and delete with a different one, so maybe that’s got something to do with it…

All this whole exercise proved to me was how much I love coding in Java. Memory allocation is such a deal to track down problems with.

In other news, JNIWrapper looks like an interesting little product. When we’re looking at Windows integration for our SpamFilter product I’ll definitely be evaluating!