Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

System.AccessViolationException was unhandled

$
0
0

Hi All,

I am using Naudio to access audio device properties and receive device connected or removed notification.

i am using MMDeviceEnumerator's RegisterEndpointNotificationCallback(IMMNotificationClient) register for notifications.

The code compiles and runs but when is connect a jack device i recieve. the following errors.

System.AccessViolationException was unhandled
  HResult=-2147467261
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  Source=mscorlib
  StackTrace:
       at System.Runtime.InteropServices.Marshal.AddRef(IntPtr pUnk)
       at System.Management.SinkForEventQuery.Indicate(IntPtr pWbemClassObject)
  InnerException: 

 FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x6aab9017, on thread 0x1f10. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Ours is a Winforms application. Please help . 


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>