Results 1 to 8 of 8

Thread: Qt Application linked to regular dll.....

  1. #1
    Join Date
    Feb 2009
    Location
    Italy ( Brixia )
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Qt Application linked to regular dll.....

    Hi All.

    I have a dll written in C++/MFC this is a regual dll dynamically linked to MFC.
    I only linked the dll to my application QT, but when I close the application are reported several memory leaks.
    This happens only lynching this type of DLL to Qt applications.

    Any idea?

  2. #2
    Join Date
    Jul 2008
    Posts
    26
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Application linked to regular dll.....

    so u have a dll file that is a mfc -library? u don't clean up something in the mfc dll.

  3. #3
    Join Date
    Feb 2009
    Location
    Italy ( Brixia )
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt Application linked to regular dll.....

    Thanks for your answer!

    but ...

    Does not allocate anything, I just lynched the dll to the application without any function call ... but in the process of issuing (exiting )....
    Do not use the DLL lynx only

  4. #4
    Join Date
    Jul 2008
    Posts
    26
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Application linked to regular dll.....

    maybe u only linked the dll , u must include path to headers, too that's generally speaking. ....i don't know what development tools u use, system ... etc

  5. #5
    Join Date
    Feb 2009
    Location
    Italy ( Brixia )
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt Application linked to regular dll.....

    right...
    I use Microsfot Visual Studio 2003 on Windows XP professional 32bit Qt version 4.5.2
    The header file, the. Lib is Ok otherwise not compile...
    The problem is that only lynching the library at closing the application appear different memory leaks ... if the same library is created lynching MFC statically all back to work ... but I can not do

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt Application linked to regular dll.....

    Does not allocate anything, I just lynched the dll to the application without any function call ...
    This is not true.
    If your application link against the DLL at run time, then the DLLMain() of your DLL gets called, and there you are very probably allocating memory (of not directly, then indirectly).
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt Application linked to regular dll.....

    (double post deleted)
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #8
    Join Date
    Feb 2009
    Location
    Italy ( Brixia )
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt Application linked to regular dll.....

    this is not true.....

    Is a regular DLL not an extension DLL....
    There is not DllMain...but InitInstance and ExitInstance...

    <CODE>
    BOOL CToolsApp::InitInstance()
    {
    CWinApp::InitInstance();

    // any DLL initialization goes here
    TRACE0("TOOLS.DLL REGULAR Initializing\n");

    // Creazione COleDataObject generale
    m_pOleDataObject = new COleDataObject();

    return TRUE;
    }

    int CToolsApp::ExitInstance()
    {

    // Libero l'OleDataObject
    if( m_pOleDataObject != NULL ) {
    m_pOleDataObject->Release();
    delete m_pOleDataObject;
    m_pOleDataObject = NULL;
    }

    TRACE0("TOOLS.DLL REGULAR Exit\n");

    return CWinApp::ExitInstance();
    }
    </CODE>

    The problem appears only when this dll is dynamically linked to MFC, when this dll is statically linked to MFC ....everything works fine...
    I presume that when these linked dynamically is done first check the memory leaks and after releasing the memory .... or something

    Thanks anyway for replying

Similar Threads

  1. Regular Expression Problem
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2009, 09:41
  2. Application seems not to be linked statically
    By Boron in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd April 2008, 17:14
  3. set a regular expression on QTextEdit
    By mattia in forum Newbie
    Replies: 3
    Last Post: 27th March 2008, 10:16
  4. Regular expression in QLineEdit?
    By vishal.chauhan in forum Qt Programming
    Replies: 3
    Last Post: 1st October 2007, 10:58
  5. Qt regular expressions!!
    By notsonerdysunny in forum Qt Programming
    Replies: 9
    Last Post: 1st April 2007, 12:56

Bookmarks

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.