This or this exception exists when we call the WebService and WCF interfaces written in C # or Java,
If it cannot be captured correctly, it will cause the applicationProgramCrash.
After searching for information, I finally found the answer to the problem!
1: when calling the interface, select' Support for Common Language Runtime libraries/CLR'(Vs2005 is like this)
2: add
# Using <mscorlib. dll>
# Include <tchar. h>
Using namespace system;
3: where exceptions may occur, use
Try ()
{}
Catch (...)
{}
In this way, all hosting exceptions can be captured.
If you want to know what the exception is, use try () {} catch (exception * E ){}
If you know the exceptions, you can directly specify them in the Catch Block, such as catch (ioexception * IOE) and catch (securityexception * se)
For more information, see Microsoft Help and Support http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx.