Ошибка: попытка чтения или записи защищенной памяти это часто указывает на то, что другая память повреждена
HI, when I run a visual application 2010 I get this error in try catch as function call test , this function get data from some dlls and C++
Ошибка :
{"Attempt to read or write Protected Memory This is often an indicating that other memory is corrupt"} System.Exception {System.AccessViolationException}
Примечание:
I have tried to see Visual studio settings in <pre>Tools menu ->Options -> Debugging -> General -> Uncheck this option "Suppress JIT optimization on module load" AND and the same error still appears or windows user as administrator or over writing the camera manufacturer's dll
Что я уже пробовал:
объявление функции
[DllImport("NVSSDK.dll", SetLastError = true)] public static extern Int32 NetClient_GetAlarmServer(Int32 _iLogonID, ref char[] _pcAlarmServer, ref Int32 _iServerPort );
Вызов из C#
char[] _pcAlarmServer = new char[16]; Int32 _iServerPort = 0; try { // HERE IS THE ERROR int iRetx1 = NVSSDK.NetClient_GetAlarmServer(_ulLogonID, ref _pcAlarmServer, ref _iServerPort); } catch (Exception ex) { }