[Solved] Using Windows Datatype HDEVINFO
-
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 -
What error messages do you get?
What is the compiler you are using? -
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 -
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 -
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? -
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 -
Ok, WinRT was the information missing.
WinRT has a limited set of winapi functions, there is a list where you can check functions by namehttps://msdn.microsoft.com/en-us/library/windows/apps/dn424765.aspx
you are rigth, the setupapi functions are not available for WinRT.