Where can I find a link explaining how to take a C / C ++ function header and define it using dllimport in C #?
I am using setupapi.dll to detect the connectivity of a USB device. It does not work properly on 64-bit versions of Windows (XP, Vista). I suspect the declarations are not entirely correct, but I'm not sure how to check. MS doesn't seem to provide dllimport information, but lists all the function definitions. Is there a resource I can use to convert between the function header and the dllimport declaration?
I used pinvoke.net, but it looks like it doesn't account for 64 bit definitions.
a source to share
Check out pinvoke.net . It has a large set of Win32 APIs already translated into DllImport definitions (including setupapi.dll).
a source to share
The tool you are looking for is called C ++ / CLI. It was built to handle these headers and generate interop code - without mixing with P / Invoke.
Write a small assembly of wrappers in C ++ / CLI and then use it from your C # code.
(It's hard to give a more specific answer since you haven't pointed out how it doesn't work as expected ...)
a source to share