문제
나 게시 코드(독자적인 문제)하지만 사람의 종류를 알고 있는 것의 원인은 다음에 오류가 있습니다.그것은에서 발생한 VOIP 클라이언트는 내가 쓴(사용 권한 api)면에서 호출이 종료되는 다른 클라이언트입니다.이 오류는 다음과 같습니다.
System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at CollabAnalysisSF.Edge.GUI.Forms.Program.Main() in d:\data\beyerss\Desktop\client\GUI\ARGui\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
업데이트:
밝혀 하나의 라이브러리를 사용하여 보내는 이벤트는 우리의 공식 응용 프로그램,그리고 문제에서 어딘가에 있을 것 이다.지금 수정되었습니다.
해결책
목록부의 가능성:
- 체가 사용되고 후 삭제됩니다.이것은 일어날 수 있는 경우가 많은 폐기 관리되는 개체를 종료자에서(당신이 해야하지 않는).
- 는 unmannaged 의 구현은 하나의 객체를 사용하는 도청하고 그것을 손상된 프로세스 메모리 힙.일이 많이와 다이렉트,GDI 및 다른 사람입니다.
- Mashaling 에서 관리되는 관리되지 않는 경계선은 결함이 있습니다.는지 확인할 핀 관리되는 포인터를 사용하기 전에 그것에서 관리되지 않은 부분의 코드입니다.
- 당신은 당신을 사용하여 안전하지 않은 블록고 재미있다.
에 당신은 경우에는 그것이 문제가 될 수 있 Windows Forms.그러나 문제는 그가 일어나고 있지만,오히려 그것은 보고되지 않는 제대로;당신은 아마도 여전히 뭔가 잘못 할 수 있습니다.
당신은 어떤 것인지 확인할 수 있어 오류를 일으키는 사용 HWND?그것은 항상 같습니까?이제 재미있는 무언가를 하기 전에 그냥 응용 프로그램?은 unmannaged 부분의 제어 사용자 지정 또는 표준 관리를 합니까?
다른 팁
이 종류의 prolem 발생할 수 있는 경우 호출하는 관리되지 않는 코어a dll.하는 경우 발생할 수 있습니다 정렬가 끔찍하게 잘못입니다.
당신이 우리를 말할 수 있는 경우 호출하는 관리되지 않는 코드?그렇다면 당신은 당신을 사용하여 기본 정렬하거나 특정요?의 모습에서 스택 추적 당신은 안전하지 않은 코드를 사용하면 예:포인터와 같은?이 될 수 있습니다.
여기에 대한 자세한 stacktrace.그것은 나에게 보이 그것을 좋아 할 수있는 뭔가가와 System.Windows.Form.dll
이 TargetSite 로 나열됩 {IntPtr DispatchMessageW(MSG ByRef)}
고 아래에서 모듈 System.windows.forms.dll