I have 2 Qt plugins, main and helper, with main.dll
loading helper.dll
. I am able to successfully load main.dll
with QPluginLoader
when both main.dll
and helper.dll
are in the same folder. When helper.dll
is absent and I try to load main.dll
an exception gets thrown. That's understandable cause helper.dll
cannot be found. My task is to successfully catch the thrown exception, rather than crashing the app. While debugging here is what Qt Creator displays:
The following code is not solving the problem, so I need to do something else...
std::exception_ptr eptr;
QPluginLoader pluginLoader(packagePath);
try
{
pluginLoader.load();
}
catch(...)
{
eptr = std::current_exception();
}