L
L
lightalex2018-11-26 19:37:30
C++ / C#
lightalex, 2018-11-26 19:37:30

How to catch an exception from an unknown location in a DLL?

Good day!
The situation is the following.
There is a central program. Let's call it Node.
Several DLLs are dynamically linked in Node (via LoadLibrary).
After connecting the DLL, it begins to live its own life (separate threads from the DLL itself are launched).
The problem is that you need to catch all exceptions from Node that may occur in the DLL in order to take action.
Is there any way to catch all exceptions that occur in the program, even if the exception occurred in an unknown thread?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Yudakov, 2018-11-26
@lightalex

I would isolate all this shitty code in separate processes - children of the process of the main program. Those. for each library - its own process is launched, where a) this library works and b) the mechanism for exchanging data with the process of the main program. Nothing else.
The child process with the library fell - and that's okay.
It is necessary, of course, to make a mechanism for interprocess communication. But since it's 24x7, you can work hard. But then you can live in peace.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question