473,371 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,371 software developers and data experts.

USB device detection Error calling function to get GUID

I am trying to write an application that will detect all the USB devices connected to my computer. For this I have declared GUID and called the following functions to get the information about devices connected.

LPGUID guid;
HidD_GetHidGuid(guid);

HDEVINFO hDevInfo;

hDevInfo = SetupDiGetClassDevs(guid,NULL,NULL,DIGCF_PRESENT |

DIGCF_INTERFACEDEVICE);


But it give the following error Ö.

error LNK2019: unresolved external symbol _imp__SetupDiGetClassDevsA@16 referenced in function "public: void __thiscall

error LNK2019: unresolved external symbol "void __stdcall HidD_GetHidGuid(struct _GUID *)"

fatal error : LNK1120: 2 unresolved externals

I donít understand that where am I making mistake? I have include the following header files :

Hidclass.h
Setupapi.h
Hidsdi.h


Can you please tell me what mistake am I making?
Jan 23 '08 #1
2 5641
sicarie
4,677 Expert Mod 4TB
And where is HidD_GetHidGuid() defined?
Jan 23 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
You have to add setupapi.lib in your project as linker input.

Go to project properties, Configuration Properties, Linker, Input and add the library name.
Jan 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: FloydPW | last post by:
I am attmempting to enable/disable a device in C#. I am able to locate it and tell it to disable, but the device will not disable even upon reboot. I am hoping someone can lead me in the right...
0
by: Farek | last post by:
(If Im posting in the wrong place concerning COM+ and .NET plz redirect me.) Hello all, Im writing a COM+ in VB.NET that is suppose to be able to set/get an address(String value). I've made...
13
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a...
5
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
0
by: Eddy_w | last post by:
Hello, I try to ping from my mobile device with a wireless connection to my pc. I found the class clsping on the internet and it works perfect with application from pc to pc but when i use it...
0
by: Lunchtimemama | last post by:
I'm looking to disable Windows autoplay for a particular device. There's a registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID)...
2
by: danielle.m.manning | last post by:
I have a question about a problem I am having with attempting to port some old ASP code to ASP.NET. We have a dll out there which we downloaded which creates GUIDs for session management. In...
3
by: ShadowLocke | last post by:
Hi all, I am trying to grab the guid for the WiFi card in Windows Mobile 5 & 6. I can use WZCEnumInterfaces and get the guid no problem...as long as the wifi card is turned on. Is there an API...
3
by: tristanlbailey | last post by:
Hello. I'm trying to create a program in Visual Basic 6 that detects when a user is attempting to remove a USB drive, by using the "Safely Remove Hardware" icon on the taskbar. There is supposed...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.