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. Is the IADs interface missing in activeds.dll, or ?
Forum Updated to NodeBB v4.3 + New Features

Is the IADs interface missing in activeds.dll, or ?

Scheduled Pinned Locked Moved Solved General and Desktop
iads
10 Posts 2 Posters 3.2k 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.
  • O Offline
    O Offline
    OveF
    wrote on last edited by VRonin
    #1

    Hello all

    I¨m trying to use the AD interface IADs to administer user accounts
    Include headers:

    #include "activeds.h" // should suffice
    

    In body:

    IADs *pObject = NULL;
    HRESULT hr = ADsOpenObject(L"LDAP://rootDSE", NULL, NULL, ADS_SECURE_AUTHENTICATION, IID_IADs, (void**)&pObject);
    

    The compiler finds all the symbols in use.
    In .pro file, to lo link with activeds.dll:

    LIBS += -Lc:\Windows\System32\activeds.dll
    

    The linker gives two warnings:

    Undefined reference to 'IID_IADs'
    undefined reference to 'AdsOpenObject@24
    

    Here the decoration @24 is clearly a problem. Found usung shell32 solved this one:
    LIBS += -Lshell32 c:\Windows\System32\activeds.dll
    The linker gives only one warnings:

    Undefined reference to 'IID_IADs'
    

    Where is IID_IADs?

    Oviously I'm doing something wrong here, but what?
    Best regards
    OveF

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      You should not try to link to the dll. You should link to a lib that will load and resolve the entry points from the dll at runtime.
      The syntax for that is LIBS += -L<Path to the lib file> -l<name of the lib without the extension>

      So instead of

      LIBS += -Lc:\Windows\System32\activeds.dll
      

      you should have something like this:

      LIBS += -L"c:/Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x64/" -lActiveds
      

      Of course substitute the path to the Windows SDK you use.
      Don't forget to re-run qmake after you modify the .pro file. (menu Build -> Run qmake)

      For the compilation error about undefined reference change IID_IADs to __uuidof(IADs). The former is just a define around that.
      @24 decoration is not a problem. This is just a name mangling scheme.

      1 Reply Last reply
      2
      • O Offline
        O Offline
        OveF
        wrote on last edited by
        #3

        Thank you for helping, Chris.
        Unfortunately, my QT library do not have the requested .lib file nor do my windows 7 version. I will try do download the file, if possible.

        Ove

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Unfortunately, my QT library do not have the requested .lib file nor do my windows 7 version. I will try do download the file, if possible.

          This is not distributed with Qt nor with Windows. You need to get a Windows SDK to develop for Windows APIs.
          Don't try to download that single file from somewhere. You'll just get mallware. Download and install proper Windows SDK from Microsoft's site.

          1 Reply Last reply
          2
          • O Offline
            O Offline
            OveF
            wrote on last edited by
            #5

            Ok, I'll try that. Thanks again.

            OveF

            1 Reply Last reply
            0
            • O Offline
              O Offline
              OveF
              wrote on last edited by
              #6

              Sorry to bother you people, but
              I have now installed Windows SDK and are linking with the static library ActiveDS.Lib. This did not resolve the problem. A little morre surfing revealed that i need ADSIid.Lib to remedy this. so I added this file too, found in the same directory.

              From the .pro file:
              LIBS += -L"c:\Programfiler\Microsoft SDKs\Windows\v7.1\Lib" -lADSIid
              LIBS += -L"c:\Programfiler\Microsoft SDKs\Windows\v7.1\Lib" -lActiveDS

              From the makefile:
              LIBS = -L"c:\Programfiler\Microsoft SDKs\Windows\v7.1\Lib" -lADSIid -lActiveDS -LC:\Qt\5.9\mingw53_32\lib ..etc.

              Linker now reports:
              "cannot find -lADSIid" (I did a copy/paste of the name)

              For shure this wasn't easy.

              OveF

              1 Reply Last reply
              0
              • Chris KawaC Offline
                Chris KawaC Offline
                Chris Kawa
                Lifetime Qt Champion
                wrote on last edited by Chris Kawa
                #7

                \ is an escape character so you can't use it like that in paths. either use / or escaped sequence \\.
                Also you don't have to specify the path every time and you can combine multiple linker inputs in one line so

                LIBS += -L"c:/Programfiler/Microsoft SDKs/Windows/v7.1/Lib" -lADSIid -lActiveDS
                

                or

                LIBS += -L"c:\\Programfiler\\Microsoft SDKs\\Windows\\v7.1\\Lib" -lADSIid -lActiveDS
                
                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  OveF
                  wrote on last edited by
                  #8

                  Hi Chris

                  This is the makefile without my libraries:
                  LIBS = -LC:\Qt\5.9\mingw53_32\lib C:\Qt\5.9\mingw53_32\lib\libQt5Multimediad.a ... etc.
                  This is my .pro file:
                  LIBS += -L"c:/Programfiler/Microsoft SDKs/Windows/v7.1/Lib" -lADSIid
                  LIBS += -L"c:/Programfiler/Microsoft SDKs/Windows/v7.1/Lib" -lActiveDS
                  This is the makefile with my libraries:
                  LIBS = -L"c:\Programfiler\Microsoft SDKs\Windows\v7.1\Lib" -lADSIid -lActiveDS -LC:\Qt\5.9\mingw53_32\lib ... etc.

                  as you can see this didn't help. Weird

                  OveF

                  1 Reply Last reply
                  0
                  • Chris KawaC Offline
                    Chris KawaC Offline
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on last edited by Chris Kawa
                    #9

                    Ah, sorry, my bad. I wrongly assumed you're using MSVC as the compiler, but apparently you're using MinGW.

                    You can't use the regular Windows SDK with it. It's not compatible.

                    MinGW has its own set of headers and libs for winapi (usually somewhat behind the current SDK). To use it it should be enough to do LIBS += -lADSIid -lActiveDS without any paths, but, unfortunately, the MinGW package distributed with Qt doesn't seem to have the ADSIid library file. It's either merged into another lib or just not implemented in MinGW. You'll have to check with MinGW's documentation which is it.

                    1 Reply Last reply
                    1
                    • O Offline
                      O Offline
                      OveF
                      wrote on last edited by
                      #10

                      Ok. Then i know what the problem is. I'll close this thread and try to re-formulate the question.

                      Thank's again, Chris

                      OveF

                      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