I was testing irrlicht along with some c++/cli managed code,
I was just using the native c++ classes without p/Invoke.
Everything went fine until I did a call to createTriangleSelector() then occurs an error :'The value of ESP could not be properly saved across function calls',
this error usually is from mixing debug-release dlls, but it's not the problem here.
I traced into irrlicht and the problem occurs in CTriangleSelector constructor, line 'IMeshBuffer *buf = mesh->getMeshBuffer(nr);',
this method simply returns the 'this' pointer.
I changed the line to 'IMeshBuffer *buf = (IMeshBuffer*)mesh;', and then works just to crash in the next line with the same error.
I don't see anything special in the CTriangleSelector or in the code of the constructor that could cause this problem,
I know the problem is not in my code because Niko's wrapper lacks this method also, it's commented in the irrlicht.net sources, because he's probably getting the same issue, so maybe he knows something about.