ArcMap C# Integration sometimes gives SEHException

2671
1
01-26-2011 06:10 AM
RemcoBurema
New Contributor
Our company has build an integration in C# that displays a Flash component in a windows form when a button is clicked in ArcMap. Customers using the application report the follwing error:

System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.AxHost.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I've had only limited success in reproducing the error (only on their systems, where I can change little about debugging, logging, etc...), and, given the stack trace, no clue where to even begin looking. The only similar ting I found on the web was the following thread on your old forums:
http://forums.esri.com/Thread.asp?c=159&f=1707&t=265242

Any pointers would be greatly appriciated.

Kind regards,
Remco Burema
0 Kudos
1 Reply
RichardWatson
Frequent Contributor
It looks like some unmanaged code is failing:

http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.sehexception.aspx

I do not know what the underlying issue is.  I think that some unmanaged code is responding to a windows message in a less than desirable manner.  Perhaps it is whatever control you are using to display Flash?

One of the challenges that everyone faces is debugging issues which only occur on production machines.  One thing that you can do is to try to capture the dump file and then examine it on a non-production machine using a debugger such as Visual Studio or WinDbg. 

The other thing that you can do is to XCopy WinDbg to the machine having the problem and debug it there.  The really cool thing about WinDbg is that it is pure XCopy, i.e. when you are done you can just delete it.  It is also free.

Good luck!
0 Kudos