I get this error when I use a c++ dll in my project.
I import the dll function with the following code
Declare Function B_C113_initial Lib "C113.dll" Alias "_C113_initial" (ByVal existobj As Integer, ByVal DeviceTb As Long) As Integer
when I call the function,
it prompt this error
An unhandled exception of type 'System.AccessViolationException' occurred in *.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.