Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Linking DLL files
QtWS25 Last Chance

Linking DLL files

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 3 Posters 5.6k 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.
  • D Offline
    D Offline
    Dachangel
    wrote on last edited by
    #1

    Hello,

    I need to link a DLL file into a QT application. the DLL file was compiled from C# Visual Studio 2010 and I have the source code and project files the DLL was created from. I've spent about three hours looking around the net and haven't even the foggiest on how to do this, or whether I even can. All the information i can find relates to C++ or C.

    The DLL file is a few classes to create an Engine object, and methods to be called on this object. I would greatly appreciate any help you can give me.

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

      if it is a C# library, you have a problem. I think, it does not only export C-style functions?
      Then you can't use it from Qt, as Qt is unmanaged C++ and not managed .Net code.

      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
      • C Offline
        C Offline
        cincirin
        wrote on last edited by
        #3

        http://msdn.microsoft.com/en-us/library/aa645738(VS.71).aspx

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

          That's the other way round, right? using C++/COM inside C#

          Afaik, you can also create COM objects with C# and then use the COM objects.

          But using a C# dll directly is not possible

          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
          • C Offline
            C Offline
            cincirin
            wrote on last edited by
            #5

            Yes, COM objects (or maybe ActiveX objects) are somewhat proxy how to use managed .Net objects in unmanaged C++ app.
            I'm not familiar with C#, but in fact, C# dll it's not "real" windows dynamic-link library, and cannot be loaded in a familar way in C++ code (i.e. LoadLibrary in windows, or dlsym in linux, mac, and in no case with QLibrary :: load).

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

              what is a "real" windows dll?
              Dll only means dynamic load library, which C# dlls are also. You only can't use them in C++. If you make native C-exports, you can also use C/C++ dlls in C#, VB, etc, but only C exports, not C++.

              So there is no "real" windows dll. Afaik, even not on Linux (if you use more than C/C++ for developement).

              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
              • C Offline
                C Offline
                cincirin
                wrote on last edited by
                #7

                Yes, you are right. I wanted to say resolve symbols instead of loading. About "real" windos dll I attempt to mention that a COM or ActiveX "dll" export only DllRegisterServer and DllUnregisterServer functions.

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

                  [quote author="cincirin" date="1301495891"]Yes, you are right. I wanted to say resolve symbols instead of loading. About "real" windos dll I attempt to mention that a COM or ActiveX "dll" export only DllRegisterServer and DllUnregisterServer functions.[/quote]

                  That is correct, and those are C-exports :-) Like in kernel32.dll etc.

                  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