Results 1 to 6 of 6

Thread: How to use a Dynamic Link Library with QT / C++.

  1. #1

    Default How to use a Dynamic Link Library with QT / C++.

    Hello people.

    I'm trying to learn how to program under this enviroment and i dont figured out yet how to use a DLL on my project.

    The problem is that I'm developing a tool that needs to comunicate with another software, to retrieve some information about my process.

    That communication is possible through a SDK dll, provided by the developer.

    The problems are:

    1) How to add a reference to this dll?

    2) After adding the reference, how to create a new instance of a class defined by the dll?

    Please help me!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to use a Dynamic Link Library with QT / C++.

    How would you do that if you weren't using Qt?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3

    Default Re: How to use a Dynamic Link Library with QT / C++.

    Quote Originally Posted by wysota View Post
    How would you do that if you weren't using Qt?

    Well... actually I know how to do this only using VB.

    There is a built-in menu where you can add the external references to your program.

    After adding these references, to create a new instance the code seems like this:

    Qt Code:
    1. Dim MyObject as iHistorian_SDK.Server
    2. Set MyObject = new iHistorian_SDK.Server
    To copy to clipboard, switch view to plain text mode 

    Was it clear?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to use a Dynamic Link Library with QT / C++.

    Please use your favourite search engine to find articles about using external libraries with C++. This is out of scope of this forum. As for Qt, use our search facilities - the issue of configuring your project to use external libraries has been brought up a couple of times. You can even scroll this thread down to the list of similar threads and read them.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5

    Default Re: How to use a Dynamic Link Library with QT / C++.

    Quote Originally Posted by wysota View Post
    Please use your favourite search engine to find articles about using external libraries with C++. This is out of scope of this forum. As for Qt, use our search facilities - the issue of configuring your project to use external libraries has been brought up a couple of times. You can even scroll this thread down to the list of similar threads and read them.

    wysota,

    Thanks for replying.

    By the way... at the first time... I thought that I had to use the QLibrary class (out of scope?! I dont think so) to implement this issue. But i did'nt figured it out.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to use a Dynamic Link Library with QT / C++.

    Quote Originally Posted by nivaldonicolau View Post
    I thought that I had to use the QLibrary class
    Not really. This is for loading libraries at runtime not when the application is started.

    Qt is not some special magic entity that forces you to do think you don't have to do with C++ or any other language similar to it. It just adds some more functionality.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Generating a static and dynamic library
    By elcuco in forum Qt Programming
    Replies: 3
    Last Post: 20th August 2011, 12:46
  2. How to link library?
    By Macok in forum Qt Tools
    Replies: 1
    Last Post: 31st March 2009, 17:47
  3. Link against library on Mac OS
    By janus in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd March 2009, 12:10
  4. Dynamic link libraries
    By nareshqt in forum Qt Programming
    Replies: 6
    Last Post: 22nd April 2008, 07:20
  5. i want dynamic link my programm
    By coder1985 in forum Installation and Deployment
    Replies: 5
    Last Post: 19th November 2007, 11:59

Tags for this Thread

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.