Reputation: 23961
I am trying to load a dll like this:
dll_handle = LoadLibraryA(QString("%1\\module.dll")
.arg(QApplication::applicationDirPath().replace("/", "\\"))
.toLocal8Bit().data());
The resulting filename that I pass to LoadLibraryA is correct, the file exists and is readable by the process. What is the problem?
Upvotes: 1
Views: 2552
Reputation: 613412
GetLastError
reports 126, i.e. ERROR_MOD_NOT_FOUND
. Clearly a module cannot be found.
There are two obvious causes for this:
I would recommend debugging this with Dependency Walker in profile mode. This will monitor your app at runtime and tell you precisely which module cannot be found.
Finally, in this day and age, you really should be opting for LoadLibraryW
.
Upvotes: 9