Qt World Summit: Register Today!

why .DLL files are unloaded and then loaded??

  • My application has an API which tries to unload and then load WSHTCPIP.DLL from System32 . First it unloads the DLL which is about 5 sec duration and then it loads the DLL which takes about 10 sec duration. So my subwindow takes almost 15sec to open it bec of this API .
    All the above i mentioned happens only for the 2nd time i call that API. when i call the API for the first time the WSHTCPIP.DLLis not getting unloaded it just loads it . hence it takes less than 1 sec duration.
    As i checked the API docs it does not have anything to do with WSHTCPIP.DLL . I do not know why this API tries to do it. I have tested in 5 computers (3 win 7, 1 vista, 1 ubuntu) . out of 5 , only 2 win 7 computer take 15 sec to open my subwindow and rest takes almost 1sec. even though other computers has WSHTCPIP.DLL in the system32 path.
    single step with setting breakpoints gave me hint that it unloads and loads.
    why somtimes .DLL files are unloaded and then loaded??
    Now i am trying to manually unload and then load that DLL when theat API is being called. I am not getting exact idea on how to do it. so far i have tried this . How to exactly unload and load this DLL when API is being called?

       bool is;
       QLibrary lib("C:/Windows/System32/WSHTCPIP.DLL");
       is = lib.isLoaded();

Log in to reply