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. Include DLL without header
QtWS25 Last Chance

Include DLL without header

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.7k Views
  • 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.
  • MenelasM Offline
    MenelasM Offline
    Menelas
    wrote on last edited by
    #1

    Hello,

    I have to write a small application in C++ with Qt. I am new on Qt. My app will communicate with a software. For the communication the software provider gave me some .dll files but without header.
    (I think theses .dll were built with Microsoft Visual Studio 2010 -> language C#, but I am not sure at all)

    I have done the same application in C# (on VS2015) this summer, and I am happy to translate this app in C++, but I don't find how include properly the .dll files. So I can't call functions from them.

    Please, can you help me with that?

    1 Reply Last reply
    0
    • sneubertS Offline
      sneubertS Offline
      sneubert
      wrote on last edited by
      #2

      For including a dll without a header you have to know the function names. For example you can use the DependecyWalker to get the function names. Then use the WinApi-Functions LoadLibraryand GetProcAddress to get the pointers to the functions.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leonardo
        wrote on last edited by
        #3

        If this dll was written in C#, then it's very likely a .NET dll. In that case, you'll need to do something like this:

        https://support.microsoft.com/en-us/kb/953836

        Or maybe write your own wrapper dll to expose the managed members in a non-managed way.

        If it's not, @sneubert is right. A more cross-platform approach would be to use QLibrary:

        http://doc.qt.io/qt-5/qlibrary.html

        1 Reply Last reply
        0
        • MenelasM Offline
          MenelasM Offline
          Menelas
          wrote on last edited by
          #4

          Thanks for your quick answers.

          I tried to look with DependencyWalker, but I have some difficulties to find classes and functions I need. There are thousands of functions in theses dll

          I will try tomorrow the solution for a .NET dll,hopefully I will make more progress by this way.

          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