Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Unsolved [Solved] Using Windows Datatype HDEVINFO

    General and Desktop
    windows include
    3
    13
    6718
    Loading More Posts
    • 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.
    • patrikd
      patrikd last edited by patrikd

      Hi all,
      I'm trying to get some device Infos on Windows. For this I need the setupapi type HDEVINFO. But I can't get the complier to know this type. I included the <setupapi.h> which QtCreator knows and references correct. I also added :

      LIBS += -L/path to the lib -lsetupapi 
      

      but still this pedantic compiler complains :(
      any hints?
      thx,
      patrik

      1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion last edited by

        What error messages do you get?
        What is the compiler you are using?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • sneubert
          sneubert last edited by

          As MSDN states HDEVINFO is a handle to a device Information set. You can use HANDLE to store this value.

          1 Reply Last reply Reply Quote 0
          • patrikd
            patrikd last edited by

            hi guys,
            thx for the fast reply :)
            @jsulm: MS Visuall C++ Compiler 14. The error is unknow type.
            @nseubert: changing to HANDLE works for HDEVINFO but that only helps partial because I also want to use SP_DEVINFO_DATA which brings me back to start.
            More hints?
            thx,
            patrik

            1 Reply Last reply Reply Quote 0
            • sneubert
              sneubert last edited by sneubert

              You have to call SetupDiEnumDeviceInfo with your Handle to extract a SP_DEVINFO_DATA structure, from the device Information set.

              have a look at
              https://msdn.microsoft.com/en-us/library/windows/hardware/ff541247(v=vs.85).aspx

              1 Reply Last reply Reply Quote 0
              • patrikd
                patrikd last edited by

                hi sneubert,
                but thats what I can't do because for all of this, including the SetupDiEnumDeviceInfo function, I need the setupapi.lib and I can't get the types and functions from this. the Compiler complains it can't find it.
                thx,
                patrik

                1 Reply Last reply Reply Quote 0
                • sneubert
                  sneubert last edited by

                  did you install any Windows sdk?

                  1 Reply Last reply Reply Quote 0
                  • patrikd
                    patrikd last edited by

                    yes, the win10 sdk. the sdk works so far fine for compiling my Project to the Emulator and device. also the qtcreator finds the correct setupapi.h file on following via f2.

                    1 Reply Last reply Reply Quote 0
                    • sneubert
                      sneubert last edited by

                      Just a guess, but i hade a similar issue. Even Windows is not case sensitive, i could´t link lib with extentions .Lib. On Win7 SDK I have SetupAPI.Lib.
                      Can you try to copy the lib to your project root folder and rename to lower case, even the extentions and link against this lib?

                      1 Reply Last reply Reply Quote 0
                      • sneubert
                        sneubert last edited by sneubert

                        and could you post your compiler output?

                        1 Reply Last reply Reply Quote 0
                        • patrikd
                          patrikd last edited by

                          I'm a little further. I just copied the setupapi.h to my project and included it directly. Still it get the errors that the types and functions are unknown. Within the code of the setupapi there is:

                          #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) ....
                          

                          within this block all the definitions are set.
                          Seems like the setupapi.h is not available for winrt but I can't find a hint in the Windows docu for that. Could it be that the setupapi is not available to winrt?
                          best,
                          patrik

                          1 Reply Last reply Reply Quote 0
                          • sneubert
                            sneubert last edited by

                            Ok, WinRT was the information missing.
                            WinRT has a limited set of winapi functions, there is a list where you can check functions by name

                            https://msdn.microsoft.com/en-us/library/windows/apps/dn424765.aspx

                            you are rigth, the setupapi functions are not available for WinRT.

                            1 Reply Last reply Reply Quote 1
                            • patrikd
                              patrikd last edited by

                              so i will look there. thx for the help.
                              patrik

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post