locked
Libraries loaded by DoDragDrop() in ole.dll RRS feed

  • Question

  • Hi all,

    I'm developping a Win32 application with Qt on Win7 and I've noticed that the first Drag event in my app is much slower than the others.

    I found that Qt calls DoDragDrop() (in ole.h) and the first time slowdown is due to DoDragDrop which loads some libraries relative to icons in Windows file explorer (such like TortoiseOverlays.dll,..).

    To bypass this behavior, I'd like to load those libraries during the startup of my application.

    How can I manage to do that ? Or anyone having a better solution ?

    Thanks by advance


    Friday, January 29, 2016 12:09 PM

Answers

  • Hi,

    Thanks for posting here.

    Could you please tell what kind of IDE do you use? Visual studio or others?

    As far as I know, LoadLibrary function in windows can help us load the library specified based on our requirement. We can use it to load the required library when we need it. In QT the similar function QLibrary Class  may help.

    Another possible way you may try is /DELAYLOAD option.

    The /DELAYLOAD option causes the DLL that's specified by dllname to be loaded only on the first call by the program to a function in that DLL. For more information, see Linker Support for Delay-Loaded DLLs. You can use this option as many times as necessary to specify as many DLLs as you choose. You must use Delayimp.lib when you link your program, or you can implement your own delay-load helper function.

    Also please note that this forum aims to discuss and ask questions about the Visual C++ IDE, libraries, samples, tools, setup, and Windows programming using MFC and ATL. If the issue is more related with QT, you may get better support from https://forum.qt.io/ QT forum.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 1, 2016 4:53 AM
  • I found that Qt calls DoDragDrop() (in ole.h) and the first time slowdown is due to DoDragDrop which loads some libraries relative to icons in Windows file explorer (such like TortoiseOverlays.dll,..).

    From this description it sounds like the Drag and Drop operation is using a custom icon.  TortoiseOverlays.dll is not a windows system DLL.  I'll guess that it is a shell extension which is why explorer loads it.

    Perhaps there is a Qt option to not use custom icons?

    You can use the Process Monitor to observe system activity and determine the DLLs that are loaded in response to a Drag and Drop operation.  You could construct a list of DLLs to preload with LoadLibrary.

    But a solution like this is system specific.  Other systems could contain different DLLs that are loaded during a Drag and Drop operation.

    Monday, February 1, 2016 11:57 AM

All replies

  • Hi,

    Thanks for posting here.

    Could you please tell what kind of IDE do you use? Visual studio or others?

    As far as I know, LoadLibrary function in windows can help us load the library specified based on our requirement. We can use it to load the required library when we need it. In QT the similar function QLibrary Class  may help.

    Another possible way you may try is /DELAYLOAD option.

    The /DELAYLOAD option causes the DLL that's specified by dllname to be loaded only on the first call by the program to a function in that DLL. For more information, see Linker Support for Delay-Loaded DLLs. You can use this option as many times as necessary to specify as many DLLs as you choose. You must use Delayimp.lib when you link your program, or you can implement your own delay-load helper function.

    Also please note that this forum aims to discuss and ask questions about the Visual C++ IDE, libraries, samples, tools, setup, and Windows programming using MFC and ATL. If the issue is more related with QT, you may get better support from https://forum.qt.io/ QT forum.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 1, 2016 4:53 AM
  • I found that Qt calls DoDragDrop() (in ole.h) and the first time slowdown is due to DoDragDrop which loads some libraries relative to icons in Windows file explorer (such like TortoiseOverlays.dll,..).

    From this description it sounds like the Drag and Drop operation is using a custom icon.  TortoiseOverlays.dll is not a windows system DLL.  I'll guess that it is a shell extension which is why explorer loads it.

    Perhaps there is a Qt option to not use custom icons?

    You can use the Process Monitor to observe system activity and determine the DLLs that are loaded in response to a Drag and Drop operation.  You could construct a list of DLLs to preload with LoadLibrary.

    But a solution like this is system specific.  Other systems could contain different DLLs that are loaded during a Drag and Drop operation.

    Monday, February 1, 2016 11:57 AM
  • I found that Qt calls DoDragDrop() (in ole.h) and the first time slowdown is due to DoDragDrop which loads some libraries relative to icons in Windows file explorer (such like TortoiseOverlays.dll,..).

    From this description it sounds like the Drag and Drop operation is using a custom icon.  TortoiseOverlays.dll is not a windows system DLL.  I'll guess that it is a shell extension which is why explorer loads it.

    Perhaps there is a Qt option to not use custom icons?

    You can use the Process Monitor to observe system activity and determine the DLLs that are loaded in response to a Drag and Drop operation.  You could construct a list of DLLs to preload with LoadLibrary.

    But a solution like this is system specific.  Other systems could contain different DLLs that are loaded during a Drag and Drop operation.

    Thanks both for your answer, I am using Visual Studio 2012 and my application is mixing Qt + MFC.

    Calling LoadLibrary() would mean that I know the libraries to load.

    I can try RLWA32's solution but it won't work well when I'll install my application on other systems. I was more looking for a dynamic way to load thoses libraries at startup.

    So maybe there is a way to load all shell extension libraries when my app is starting ?

    Friday, February 5, 2016 1:40 PM
  • Is your app using custom icons for Drag and Drop?

    • Edited by RLWA32 Friday, February 5, 2016 2:03 PM
    Friday, February 5, 2016 2:02 PM
  • No, it uses the default one.
    Monday, February 8, 2016 4:39 PM
  • No, it uses the default one.

    Out of curiosity, do you see the same slowdown if your code is running on a system that doesn't have a bunch of shell extensions loaded?
    Monday, February 8, 2016 5:01 PM