Click here to Skip to main content
15,906,816 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to use progressbar for copying file ? Pin
Vega0220-Oct-06 6:57
Vega0220-Oct-06 6:57 
GeneralRe: how to use progressbar for copying file ? Pin
hdv21220-Oct-06 8:00
hdv21220-Oct-06 8:00 
GeneralRe: how to use progressbar for copying file ? Pin
Christian Graus20-Oct-06 8:10
protectorChristian Graus20-Oct-06 8:10 
GeneralRe: how to use progressbar for copying file ? Pin
Vega0220-Oct-06 8:11
Vega0220-Oct-06 8:11 
QuestionHelp Pin
jluis_hdezg20-Oct-06 6:08
jluis_hdezg20-Oct-06 6:08 
AnswerRe: Help Pin
Vega0220-Oct-06 7:00
Vega0220-Oct-06 7:00 
QuestionUSB HID POS Pin
Kenny O'Dell20-Oct-06 6:03
Kenny O'Dell20-Oct-06 6:03 
AnswerRe: USB HID POS Pin
eggie520-Oct-06 21:16
eggie520-Oct-06 21:16 
Hi,

Since it's a USB HID device, things are already much easier -- not that they were hard in the first place. The method of communicating with a HID device (redundant) in windows is this:

(Note: this is just a brief summary from my mind, detailed instructions can be found from this page, http://www.lvr.com/hidpage.htm[^])


1. Get the HID GUID for the system w/ the win api function HidD_GetHidGuid
2. Call the SetupDiGetClassDevs function which returns an array of active HID devices
3. Now, loop through each device and match against a product and vendor id of the device you want, using the SetupDiGetDeviceInterfaceDetail function
(this should be unique to each device and can be found via msinfo32.exe)
4. Now get the handle to the device with the CreateFile function an the device pathname from the previous step
5. Get the capabilities for the device, ie input/output report length (HID terminology)
6. SO now, you finally have the device and you can start communications with it
7. You can write to the USB HID when it has a handle to the HID
interface and knows the number of bytes it allows you to write. To write data, the
application copies the data to send to a buffer and calls win api function WriteFile. The
buffer size should equal the size reported in the OutputReportByteLength
property of the HIDP_CAPS structure returned by HidP_GetCaps. This
size equals the report size in bytes plus one byte for the Report ID, which is
the first byte in the buffer. (this is all obtained from step 5)
8. To read input from the device you use WriteFile's compliment, ReadFile a win api function.

... and that's about it! Just as long as you know the API of your device so you can make sense out of it's input you'll be fine. There's lots of work already done for .net HID interaction, all of which can be found from the HID page linked above.

/\ |_ E X E GG

GeneralRe: USB HID POS Pin
Kenny O'Dell23-Oct-06 5:59
Kenny O'Dell23-Oct-06 5:59 
Questionfoxpro general field type and c# byte[] Pin
mcgahanfl20-Oct-06 5:56
mcgahanfl20-Oct-06 5:56 
QuestionSplitContainer Pin
alpha_1020-Oct-06 5:54
alpha_1020-Oct-06 5:54 
AnswerRe: SplitContainer Pin
salysle20-Oct-06 17:07
salysle20-Oct-06 17:07 
QuestionRe: SplitContainer [modified] Pin
alpha_1022-Oct-06 21:24
alpha_1022-Oct-06 21:24 
AnswerRe: SplitContainer Pin
salysle23-Oct-06 15:50
salysle23-Oct-06 15:50 
QuestionFormat a long value to a date time value Pin
jluis_hdezg20-Oct-06 5:42
jluis_hdezg20-Oct-06 5:42 
AnswerRe: Format a long value to a date time value Pin
Dustin Metzgar20-Oct-06 6:41
Dustin Metzgar20-Oct-06 6:41 
AnswerRe: Format a long value to a date time value Pin
Larantz20-Oct-06 13:42
Larantz20-Oct-06 13:42 
QuestionDifference between two time span in C# Pin
onlybabla20-Oct-06 5:13
onlybabla20-Oct-06 5:13 
AnswerRe: Difference between two time span in C# Pin
Dustin Metzgar20-Oct-06 6:49
Dustin Metzgar20-Oct-06 6:49 
Questionpassing XML from embedded webbrowser to C# Pin
jarlath20-Oct-06 5:02
jarlath20-Oct-06 5:02 
Questionhow to develop web based vs desktop application Pin
yasminnnnn20-Oct-06 4:44
yasminnnnn20-Oct-06 4:44 
AnswerRe: how to develop web based vs desktop application Pin
Judah Gabriel Himango20-Oct-06 4:56
sponsorJudah Gabriel Himango20-Oct-06 4:56 
GeneralRe: how to develop web based vs desktop application Pin
yasminnnnn20-Oct-06 10:51
yasminnnnn20-Oct-06 10:51 
GeneralRe: how to develop web based vs desktop application Pin
Judah Gabriel Himango22-Oct-06 9:10
sponsorJudah Gabriel Himango22-Oct-06 9:10 
QuestionWEB CONFIG Question - Please Help Pin
iamnew2C#20-Oct-06 4:32
iamnew2C#20-Oct-06 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.