System.AccessViolationException with a .dll I compile
I am compiling a project into a .dll and trying to use it in another project. For most of the funct开发者_如何学Goions I use in this library, I get a System.AccessViolationException exception :
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at nglib.Ng_GetPoint(Void** , Int32 , Double* ) at ForwardModelingPlugin.CustomMeshVol3D.tesselate(CustomMeshVol3D* )
The lib I am using is called nglib - part of netgen, an open source mesher.
I have read a lot of related errors, but I don't understand why it is happening. And I cannot go into this library because it's unmanaged and the rest of my project is managed.
Thanks
AccessViolationException means either:
- There is a bug in the library you are using, or
- You are passing the library invalid arguments.
精彩评论