I\'m using two commercial libraries that are produced by the same vendor, called VendorLibA and VendorLibB. The libraries are distributed as many DLLs that depend on the com
I had a similar problem. Specifically I wanted to use a PyQt from a Python interpreter embedded in an application that was using an incompatible version of Qt. There were two Qt DLLs used by the primary application: QtCore.dll and QtGui.dll.
When I would load PyQt from the embedded Python interpreter, I would get an error:
ImportError: DLL load failed: The specified procedure could not be found.
This occured on the line:
from PyQt4 import QtGui
The problem is that the once an incompatible QtGui.dll is loaded into the main application's process space any references to QtGui.dll (e.g. from the file QtGui.pyd) are incorrect.
What happened next, I am not proud of.
First I renamed
QtGui4.dll
in the PyQt distribution toQtGuiX.dll
and then renamed theQtCore4.dll
toQtCoreX.dll
. Notice that the renaming maintained the same number of characters, this is important.Next I opened the file
QtGui.pyd
in Notepad++, and replaced all plain-text references ofQtGui4.dll
toQtGuiX.dll
and fromQtCore4.dll
toQtCoreX.dll
. I repeated the process for the files:QtCore.pyd
,QtGuiX.dll
andQtCoreX.dll
.Finally I checked that my PyQt test application still worked. It did! Then I tried running the PyQt test application from the embedded Python interpreter, and it worked as well.
So, it seems to works in a couple of trivial cases. I expect that I need to repeat the process for all DLLs and PYDs in the PyQt distribution.
This is probably not the right way to do things, but I can't think of any concrete reasons how it could blow up (other than if I change the length of the file name).
Credit (or blame) to others on the thread for inspiring this terrible tale.