Dominic Orchard - 2008-04-06

Hi, this is a repeat of a message I posted to the developers forum. Apologies for the double post but I thought it would be more likely to be seen here. Thank you.

Hi,
I'm trying to use the CVODE library in a new cell simulator being developed in research at the moment.
I have borrowed some code from SBW for interfacing with the CVODE C library and I have got it working fine solving ODEs from C#.
However, whenever I try and instantiate two models at once they seme to interfere and share the same RHS ModelFunction. In fact only one model function gets called, totally destroying the results of each model. 
I have tried using newer versions of CVODE but to be honest the whole C# DllImport system is baffling me at the moment because it seems to be able to find and not find dlls at will and I can't tell which version of the DLLs its using and when I look at the latest CVode code the C interface looks quite different (NVectors don't have the same interface).
Basically I'd love some information from whoever developed the C# interface code because I clearly am missing the point on how Dllimports work, and it is impeding me trying to fix this other bug, which I am attributing to some pointer errors in the C. Is there a custom version of CVODE being used here anyway, if so can I get the C source code for that?
Any help would be much appreciated as we need to get this done as soon as possible.
Thanks,
Dominic