[Interest] Is it possible to override dll in runtime in Qt?

Koehne Kai Kai.Koehne at digia.com
Wed Apr 9 08:41:45 CEST 2014



> -----Original Message-----
> From: interest-bounces+kai.koehne=digia.com at qt-project.org
> [mailto:interest-bounces+kai.koehne=digia.com at qt-project.org] On Behalf Of
> Vincent Cai
> Sent: Wednesday, April 09, 2014 7:04 AM
> To: interest at qt-project.org
> Subject: [Interest] Is it possible to override dll in runtime in Qt?
> 
> Dear All,
> 
> 
> 
> I have an Qt application, which uses 2 dll, one is Prmt.dll and the other is
> Core.dll. Core.dll is dependent on Prmt.dll. Prmt.dll has multiple instances in
> different folders, for example: A/Prmt.dll, B/Prmt.dll... The Qt application
> provides an option to choose Prmt.dll, so it need to override Prmt.dll in
> runtime. Is it possible to override dll in runtime in Qt?

Which exact dll is loaded isn't something Qt can really influence. Check out

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx

for the full details on Windows :)

If you're loading Prmt.dll as a hard dependency of Core.dll there's nothing you can do in the programming logic itself, and you've to set up things "from the outside" (e.g. by changing a PATH environment variable in a launch.bat file , or something similar). If you're loading Prmt.dll dynamically at runtime (like a plugin), you can set an absolute path in your code.

Regards

Kai



More information about the Interest mailing list