Results 1 to 4 of 4

Thread: Using Qt with third party hardware DLLs

  1. #1
    Join Date
    Apr 2007
    Posts
    16
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Using Qt with third party hardware DLLs

    Hi All,
    I wish to use Qt to develop a GUI application and want to link it with DLLs with Card APIs from vendor. These are from Adlink, Moxa and some other companies. The examples they give are all for some old Visual Studio Application. I do not wish to use Visual Studio At all.
    How does one interface these DLLs with a new Qt Application?
    Any help or idea would be appreciated.
    I tried to get in touch with the vendor but they have not replied.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using Qt with third party hardware DLLs

    This same way like every other library. Qt is not a magic. This is a C++ library too.

  3. #3
    Join Date
    Apr 2007
    Posts
    16
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using Qt with third party hardware DLLs

    Let me be more specific about my query.
    The driver libraries have 99.99% been made with some version of Visual Studio and I have Qt with mingw installed.
    Do these type of DLLs work with the mingw installation or will work with a VS version only?
    I have earlier integrated third party qserialport which has a .so file generated by compiling with the linux qt which was not a problem.
    Hope my query is more clear now and I will get the correct reply.

  4. #4
    Join Date
    Apr 2007
    Posts
    16
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using Qt with third party hardware DLLs

    I had been trying to sort out my problem with the Adlink Cards and finally understood how to go about it. I thought I will post the details here so that someone else with the same problem need not struggle.

    I tried this out with 5.1.1 version of QT with mingw build system. I installed the required Adlink drivers also. You must ensure the drivers are correctly installed.

    I made the following entries in the .pro file (my project was made in qt creator as a normal console program but should work with qt projects too).

    win32:LIBS += C:/ADLINK/PCIS-DASK/Lib/PCI-DASK.lib
    INCLUDEPATH += C:/ADLINK/PCIS-DASK/Include
    DEPENDPATH += C:/ADLINK/PCIS-DASK/Include

    For some strange reason, I had to give these absolute paths. Using the qtcreator options strangely did not work for me in this case. I wonder why giving the location with LIBS += -L/to/path -lPCI-DASK was not working (that directory has PCIS-DASK.lib and PCIS-DASK.dll).

    Also, when trying to add the header file and write code, I found I was getting some compile errors as BOOLEAN, VOID and HANDLE were not defined.

    Your declaration in the source file should look as follows for it to compile seamlessly:-

    typedef bool BOOLEAN;
    typedef void VOID;
    typedef long HANDLE;

    Regarding my query about whether different DLLs will work with mingw qt or not, I have bit more clarity.
    It seems there are two types of DLLs (I maybe explaining a bit non-technically). One are DLLs which export parameter names as C(plain) names. These type of DLLs shall work with both MSVC Qt as well as MINGW Qt. The second type are libraries which export C++ objects (mangled names). In this case, we must match the compilers (This almost mandates the use of MSVC if the third party libraries are this type).

    This is my understanding of the thing. Hope this will help someone else grappling with the same issue.

Similar Threads

  1. QT4 vs QT2: hardware requirements
    By Yuri T in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 9th December 2016, 09:52
  2. Hardware ID Protection?
    By xyz247 in forum Qt Programming
    Replies: 0
    Last Post: 5th November 2012, 04:53
  3. Hardware address
    By vajindarladdad in forum Newbie
    Replies: 6
    Last Post: 12th November 2009, 09:57
  4. How to use Hardware cursor
    By arunvv in forum Newbie
    Replies: 0
    Last Post: 16th September 2008, 23:38
  5. detecting Hardware?!?!
    By nupul in forum Newbie
    Replies: 2
    Last Post: 7th April 2006, 08:50

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.