Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use an interface and a function that is present in a .dll
Forum Updated to NodeBB v4.3 + New Features

How to use an interface and a function that is present in a .dll

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sriharsha
    wrote on last edited by
    #1

    hi, i am new to qt. i m developing a tool for controlling a CCD. i have the drivers required and i have tried to include the .dll file in my program using QLibrary but i have no idea how to include the required interfaces and the corresponding functions in my program. i have no idea how to include it during the compiletime but since there is no particular header file.
    thanks in advance.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi sriharsha,

      there is no general answer to that. First you have to think of the interface. is it:

      pure C interface (only eC exported functions) in the dll

      C++ interface (exported classes from the dll)

      This has much influence on how to use it.

      If it's a C-interface, you can use late binding: Use "QLibrary":http://doc.qt.nokia.com/latest/qlibrary.html to load the library and "QLibrary::resolve":http://doc.qt.nokia.com/latest/qlibrary.html#resolve to get the function pointers. If you don't know how to use function pointers, you could look "here":http://www.cprogramming.com/tutorial/function-pointers.html or use google :-)

      If it's a C++ library you need the header files and an import library (on windows MSVS it would be a .lib file, for gcc a .a file). Without header and import lib file, I see no chance to use a C++ dll :-(

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved