简体   繁体   中英

C++ Load two versions of Qt5GUI.dll

I've readed a similar question (and reply) here: Can I use two incompatible versions of the same DLL in the same process? But I cannot modify the Qt5Gui.dll file as was done by that user.

My problem comes from using Maya software that uses and includes that library at 5.6 version and I need to create a new plugin dll that uses 5.7 version of Qt5Gui (its needed by third party libraries) and when I try to load that 5.7 one its sure that 5.6 is already loaded so executing

    mModule = LoadLibraryEx(absDllPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);

returns error 127: The specified procedure could not be found.

The weird thing is that Qt5Core and others were loaded ok.

Thank you in advance for any tip.

I would solve such problem by delegating the Maya's tasks to a sub-process that a plugin dll would create and interact with that sub-process by means of RPC , pipes or shared memory or combination of them. This allows the Qt v5.7 dll to be accessible directly in the plugin dll while Qt v5.6 is only needed for Maya to function correctly.

Edit: As you commented further that only one of dependency dll s requires Qt v5.7 the split may be different: if that dll provides less data/services to your plugin than Maya , then it might be more proper to create a sub-process to host that dll instead of Maya .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM