Results 1 to 3 of 3

Thread: QT dll questions

  1. #1

    Default QT dll questions

    If i make a QT dll i have the following 2 questions

    1.) Is there a depedency i will need to install or distribute with my dll in order for the user to load the dll so it can load a window?

    2.) How do i execute the code in the dll? with a simply loadlibrary call?( that is if im on windows )

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QT dll questions

    Quote Originally Posted by maybnxtseasn View Post
    1.) Is there a depedency i will need to install or distribute with my dll in order for the user to load the dll so it can load a window?
    Yes, any Qt library or plugin that the DLL depends on. It will be at least QtCore4.dll, QtGui4.dll and probably much more.

    2.) How do i execute the code in the dll? with a simply loadlibrary call?( that is if im on windows )
    You can link your other program against the library and rely on Windows to implicitly load the DLL and make its content available.

    Or, you can load it yourself using LoadLibrary. LoadLibrary does not execute any user code in the library other than DllMain, which Qt tends to hide from you. To do anything useful with the DLL after this will require using GetProcAddress.

    Or, if your library is an ActiveX control you use it like any other registered control.

  3. #3
    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 dll questions

    1.) Is there a depedency i will need to install or distribute with my dll in order for the user to load the dll so it can load a window?
    Another option is to built Qt as a static lib, then you link it to your application, and you don't have any other Qt related dependencies.
    The down side of this approach is the size of the exe, and it wont scale with future Qt versions.
    ==========================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.

Similar Threads

  1. Qt like VS add-in questions
    By GreenScape in forum General Programming
    Replies: 0
    Last Post: 4th August 2010, 09:28
  2. New to QT and have a few questions.
    By vbman213 in forum Newbie
    Replies: 3
    Last Post: 1st February 2010, 06:50
  3. Few questions
    By ComaWhite in forum The Model-View Framework
    Replies: 4
    Last Post: 20th March 2009, 04:10
  4. MVC Questions
    By ComaWhite in forum Qt Programming
    Replies: 1
    Last Post: 14th March 2009, 05:31
  5. A few questions about Qt/Win
    By Bojan in forum Installation and Deployment
    Replies: 3
    Last Post: 16th January 2006, 09:54

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.