Page 1 of 1

FatalExecutionEngineError with SimConnect C#

Posted: Sun May 03, 2020 11:47 am
by Kaiii3

I got from time to time CTDs with my C# Application using the v45HF3 SimConnect DLL:


Code: Select all


Code: Select all

bei System.Runtime.InteropServices.Marshal.PtrToStructureHelper(IntPtr ptr, Object structure, Boolean allowValueClasses) bei System.Runtime.InteropServices.Marshal.PtrToStructure(IntPtr ptr, Type structureType) bei LockheedMartin.Prepar3D.SimConnect.SimConnect.MarshalRECVPtrToObject(UInt32 dwID, Void* pData) bei LockheedMartin.Prepar3D.SimConnect.CSignalProcDelegateMarshaler.CallSignalProc(SIMCONNECT_RECV* pData, UInt32 cbData, Void* pContext) bei SimConnect_CallDispatch(Void* , IntPtr , Void* ) bei LockheedMartin.Prepar3D.SimConnect.SimConnect.ReceiveDispatch(SignalProcDelegate pfcnSignal) bei AIGTech.TrafficController.Controller.SimConnectController.HandleSimConnectEvents(IntPtr hWnd, Int32 message, IntPtr wParam, IntPtr lParam, Boolean& isHandled) in D:\Eigene Datein\Eigene Dokumente\Visual Studio 2013\AIGTech\AIGTech - Traffic Controller\Controller\SimConnectController.cs:Zeile 50.
this is my code:

Code: Select all

private IntPtr HandleSimConnectEvents(IntPtr hWnd, int message, IntPtr wParam, IntPtr lParam, ref bool isHandled) { isHandled = false; switch (message) { case WM_USER_SIMCONNECT: { if (this.SimConnect != null) { try { this.SimConnect.ReceiveMessage(); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } isHandled = true; } } break; default: break; } return IntPtr.Zero; }
Anyone an idea how to handle that, or what could cause this?