Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I'm using a DLL with QLibrary in order to control a machine.
I load the library and resole functions.
Then i call an init() function from the library.
When the machine is not detected on the network, this function return -1 and i can't unload the library. I close all the windows and the app crash fiew seconds later.
Thx for help
You should be able to call
if you are the only instance using the DLL.
Else You cannot unload it.
"Note that on Mac OS X 10.3 (Panther), dynamic libraries cannot be unloaded."
A Former User last edited by
@Zoptune Why does it crash? What does the debugger say?
I think I'm the only instance using the DLL
When the machine is detected on the network, unload work fine.
Ok. it sounds like the DLL does something in init() when it fails.
You need to look at that code to know.
When the machine is not detected, my app is useless. So i just close it.
Closing my app call the unload function in an object destructor.
Then i quit and wait the thread where the DLL was used and stop the app.
But when all windows are closed and app seems to be stoped, i don't have any message like :
PATH\debug\test.exe exited with code 0
4 or 5 seconds later i have the message :
I haven't got the code of the DLL ><
Oh. It seems that on fail (-1), it might spawn something or
be in funny state so it sounds like its still active
when App is closed.
What DLL is it?
It's a DLL provided by the manufacturer of the machine.
They have their own software to control the machine but this software doesn't match my company needs.
So they provided us the DLL and the documentation and i'm developing our soft.
Out of curiosity, why not link your application to that library ? Or do you only got the .dll file ?
Yes i only got the DLL file ><
m.sue last edited by
they gave you the DLL and the documentation. So you could ask them about the error.
I send them an email.
I created this topic to ask if it was possible that the problem came from my side.
If you do not touch any function in the DLL after you call init() and it return -1, then
its not likely its in your code.
Also, would be fast to make small test project and test this.
I made several tests and i'm sure that the problem comes from the DLL.
Thx all, and sorry to have wasted your time ^^'