Click to See Complete Forum and Search --> : SEHException : External component has thrown an exception


arfate2
November 29th, 2005, 04:11 PM
Hi All,

I am developing an application which has a GUI based on Windows forms and it implements some complex image processing algorithms. A part of the code is written by somebody else, which uses ANSI C and std C++ functions. I ns hort an unmanaged code. Most of the code that I have written is a managed code and uses .NET framework classes.

Having given the background, when I run the program I get a "System::Rumtime::InterOpServices::SEHException : External Component has thrown an exception" message. When I break into the program, it takes me to a nomemory.cpp file (seems like its throwing the exception at a new operator). While searching about the Exception on msdn and google, I came across something which says that this exception is thrown when a certain unmanaged part of the code throws an exception and it cannot be mapped to a managed exception. Then I tried to catch the exception at the point where I am using the new operator.. it surpasses the catch block and displays a message that the exception thrown cannot be handled and gives two hex nos relating to process and object. When I break into this message, the debugger shows another exception dialogue box saying that a System.StackOverflowException has occured. But again when I try to catch this exception, it does not let me handle the exception.

Can anybody help me with this?

Thanks,
A

NoHero
December 1st, 2005, 08:13 AM
So your third party library is allocating a huge memory block using new. New fails by throwing an exception and your C# application catches this exceptions. You should take a look once again if you called the method proberly and/or contact the developer/team who made your third party library.