Results 1 to 2 of 2

Thread: Remove library after unloading

  1. #1
    Join Date
    Apr 2010
    Qt products
    Unix/X11 Windows

    Default Remove library after unloading

    Hi all,

    I am trying to make an application (for windows) which can be updated by replacing the dll library at run-time, problem is that the exe seems to keep the dll file locked after unloading.

    What I'm trying to do in code:
    Qt Code:
    1. QLibrary* Lib = new QLibrary("library");
    2. if(!Lib->load()) {
    3. qDebug() << mainLib->errorString();
    4. }
    5. ...
    6. if( Lib->unload() ) {
    7. delete Lib;
    8. QFile::remove(libraryPath) //fails as file is locked :(
    9. }
    To copy to clipboard, switch view to plain text mode 
    I've checked that the dll file is closed (process monitor, sysinternals) when trying to remove.

    Does anybody know if this is something which can't be done by qLibrary, a Windows probem or whether an app restart is required?

  2. #2
    Join Date
    Apr 2010
    Qt products
    Unix/X11 Windows

    Default Re: Remove library after unloading

    Found the answer, I wasn't dynamically loading the dll's. Used the option 'delay loaded dll's' in visual studio.

Similar Threads

  1. Replies: 4
    Last Post: 18th December 2009, 18:55
  2. Replies: 1
    Last Post: 13th August 2009, 16:32
  3. Remove Help option
    By bismitapadhy in forum Qt Programming
    Replies: 4
    Last Post: 15th June 2009, 13:23
  4. QTableWidget Bug : can't remove row !
    By QAmazigh in forum Qt Programming
    Replies: 7
    Last Post: 17th May 2009, 11:14
  5. remove seperator
    By navi1084 in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2009, 05:05

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.