SetupAPI library:SetupDiGetDeviceRegistryProperty function issue (VC++ 6.0)!
-
Hi, I'm fairly new to VC++ and I'm trying to develop a device manager type of utility.The problem I'm facing is with SPDRP_INSTALL_STATE property. Whenever I try to retreive this property I get the following error at compile time. error C2065: 'SPDRP_INSTALL_STATE' : undeclared identifier My syntax is: SetupDiGetDeviceRegistryProperty(dInfoSet,&devInfo,SPDRP_INSTALL_STATE,&dwT,(PBYTE)&dwIS,sizeof(dwIS),NULL); where dwIS and dwT are both DWORD. I also tried the following syntax: SetupDiGetDeviceRegistryProperty(dInfoSet,&devInfo,SPDRP_INSTALL_STATE,NULL,NULL,0,&reqSz); szBuf=(char *)malloc(reqSz); SetupDiGetDeviceRegistryProperty(dInfoSet,&devInfo,SPDRP_INSTALL_STATE,NULL,(unsigned char *)szBuf,reqSz,&reqSz); Both give the same compilation error.I should also like to point out that the latter snippet works with other properties like SPDRP_DEVICETYPE. I've hit a dead end because of this as I need to know if the device is working properly.Any ideas?? Do I need to use cfgmgr32.h ?(Although I doubt it) Please help :((
-
Hi, I'm fairly new to VC++ and I'm trying to develop a device manager type of utility.The problem I'm facing is with SPDRP_INSTALL_STATE property. Whenever I try to retreive this property I get the following error at compile time. error C2065: 'SPDRP_INSTALL_STATE' : undeclared identifier My syntax is: SetupDiGetDeviceRegistryProperty(dInfoSet,&devInfo,SPDRP_INSTALL_STATE,&dwT,(PBYTE)&dwIS,sizeof(dwIS),NULL); where dwIS and dwT are both DWORD. I also tried the following syntax: SetupDiGetDeviceRegistryProperty(dInfoSet,&devInfo,SPDRP_INSTALL_STATE,NULL,NULL,0,&reqSz); szBuf=(char *)malloc(reqSz); SetupDiGetDeviceRegistryProperty(dInfoSet,&devInfo,SPDRP_INSTALL_STATE,NULL,(unsigned char *)szBuf,reqSz,&reqSz); Both give the same compilation error.I should also like to point out that the latter snippet works with other properties like SPDRP_DEVICETYPE. I've hit a dead end because of this as I need to know if the device is working properly.Any ideas?? Do I need to use cfgmgr32.h ?(Although I doubt it) Please help :((
-
Do you have an old SDK? I don't know, but both values are defined in setupapi.h on my installation (w/o any #ifdefs) #define SPDRP_DEVTYPE (0x00000019) // Device Type (R/W) #define SPDRP_INSTALL_STATE (0x00000022) // Device Install State (R)
Well it must be old since it is the setupAPI.h that originally came with VC++ 6.0.0.8167 in 1998. And I checked the setupAPI.h and it doesn't have SPDRP_INSTALL_STATE property defined in it. So what should I do? Should I download new setupAPI.h and setupAPI.lib files to replace the old ones? Wouldn't there be any compatibility issues then? Even the SetupDiGetClassDevsEx in this header uses 6 parameters instead of 7 as in the newer version. But it works fine so I didn't bother!
-
Well it must be old since it is the setupAPI.h that originally came with VC++ 6.0.0.8167 in 1998. And I checked the setupAPI.h and it doesn't have SPDRP_INSTALL_STATE property defined in it. So what should I do? Should I download new setupAPI.h and setupAPI.lib files to replace the old ones? Wouldn't there be any compatibility issues then? Even the SetupDiGetClassDevsEx in this header uses 6 parameters instead of 7 as in the newer version. But it works fine so I didn't bother!
-
Well it must be old since it is the setupAPI.h that originally came with VC++ 6.0.0.8167 in 1998. And I checked the setupAPI.h and it doesn't have SPDRP_INSTALL_STATE property defined in it. So what should I do? Should I download new setupAPI.h and setupAPI.lib files to replace the old ones? Wouldn't there be any compatibility issues then? Even the SetupDiGetClassDevsEx in this header uses 6 parameters instead of 7 as in the newer version. But it works fine so I didn't bother!
callousfantom wrote:
So what should I do? Should I download new setupAPI.h and setupAPI.lib files to replace the old ones?
Visual Studio 6 is a very old development platform which was released way before even Windows XP was available. It is a very good IDE and there are many software developers still using it. You need to bring it up-to-date. I highly recommend the following: 1.) Install Visual Studio service pack 6[^] 2.) Install Windows Server 2003 Platform SDK[^] The Windows Server 2003 PSDK was the last SDK which was guaranteed to be compatiable with VC6... if you want to try a later SDK your on your own. Best Wishes, -David Delaune
-
callousfantom wrote:
So what should I do? Should I download new setupAPI.h and setupAPI.lib files to replace the old ones?
Visual Studio 6 is a very old development platform which was released way before even Windows XP was available. It is a very good IDE and there are many software developers still using it. You need to bring it up-to-date. I highly recommend the following: 1.) Install Visual Studio service pack 6[^] 2.) Install Windows Server 2003 Platform SDK[^] The Windows Server 2003 PSDK was the last SDK which was guaranteed to be compatiable with VC6... if you want to try a later SDK your on your own. Best Wishes, -David Delaune
Thanks guys! I upgraded using the service pack 6 and used the latest SDK and that solved the problem:)
modified on Wednesday, June 17, 2009 1:23 AM