tags:

views:

100

answers:

2

Hi all,

I have written a win32 program for detecting USB port device insert and removal. For this i have used dbt.h header file provided by system. But still my program fails to link to that and hence my program dont compile. I have Windows DDK installed on my system and i can find 4 diffrent dbt.h header files.

which one is correct one to connect and how to connect to it.

thanks in advance Vinayaka Karjigi

+1  A: 

You need to include the header file but you also need to link the dll that contains the actual code.

Jack B Nimble
Very true. Ensure that it matches the include file, if there is more than one.
ChrisBD
You need to link to the .LIB. The corresponding DLL is part of the OS. There are 4 versions to match different OS versions; take the lowest version you need to support. The Vista DLL is compatible with the XP header.
MSalters
A: 

How are you including this in your project? It is possible that you haven't got a search path set for the directory that the file resides in.

As there are multiple versions. I would copy the one that I want into the project directory and include using the quote format for local files rather than the chevrons for system files.

ChrisBD