I am developing C++ component dll that can be used by C or C++ applications. The exposed dll functions are as follows
#include
#ifdef IMPORT
Only propagate exceptions to the caller if the caller is designed to handle them. I guess in your case terminate()
will be called immediately once any exception escapes C++ code because from the point of C++ runtime that exception has not been handled.
The same situation arises in COM servers design - the clients can be in whatever language/technology. The rul is that no exceptions should escape COM server methods - all exceptions must be caught and translated in HRESULT and (optionally) IErrorInfo. You should do similarly in your situations.
In case C code is sandwiched between two layers of C++ code propagating exceptions to C code is still a very bad idea.