I have also tried removing the
extern "C"
and using the mangled function name, but it did not change a thing.

To see where the problem was I also changed the function in the dll so that it returned float instead of the pointer float* to the bunch of floats that I want the function to return. (Ofcourse I also changed the VB prog to match this)

Then I did not get the marshal error, instead I got this error message:

An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication1.exe

Additional information: Object reference not set to an instance of an object.


Any clue?