Values for the ''HidD_GetProductString' Function

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
rajupatil81
Posts: 3
Joined: Wed Apr 09, 2008 7:35 am

Values for the ''HidD_GetProductString' Function

Post by rajupatil81 » Wed Apr 09, 2008 8:35 am

Dear all

I am Raj.
I am doing small application in VB6 to communicate with generic device using HID.

I am not able to get the name using the Name of the attached USB Device Using API call Of 'HidD_GetProductString' function of Hid.dll.

Actually I am not able pass the values for the parameter 'ByVal lpBuffer As String', 'ByVal lpBuffer1 As Long'

How and what values should I pass to this parameter to get the device name

Waiting for your valuable reply.
Warm regards,
Raj

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Wed Apr 09, 2008 8:58 am

This taken from

http://download.intel.com/intelpress/us ... DHIDVB.PDF

Code: Select all

' Get Product name if present
If HidD_GetProductString(HidHandle&, AddressFor(Buffer(0)), UBound(Buffer)) Then
   temp$ = temp$ & " '": i& = 0
   Do While Buffer(i&) <> 0
      temp$ = temp$ & Chr(Buffer(i&))
      i& = i& + 2
   Loop
   temp$ = temp$ & "'"
End If
Apart from that I cannot really help as I do not know VB...

rajupatil81
Posts: 3
Joined: Wed Apr 09, 2008 7:35 am

Thanks David

Post by rajupatil81 » Wed Apr 09, 2008 9:30 am

Dear David,

Thanks for the prompt replay

Raj

xor
Posts: 286
Joined: Sun Nov 05, 2006 1:15 pm
Location: NYC
Contact:

Post by xor » Wed Apr 09, 2008 2:13 pm

I can highly recommend the VB example by Jan Axelson on her webpage at:
http://www.lvr.com/hidpage.htm

The example is very well commented and easy to follow (in my opinion). It demonstrates how to use the built-in functions of Windows for HID communication, including a couple of her own added tweaks to avoid some potential hangups. I simply used and rewrote sections to fit my program needs. It's plug-n-play when done correctly.

rajupatil81
Posts: 3
Joined: Wed Apr 09, 2008 7:35 am

Thnaks!

Post by rajupatil81 » Thu Apr 10, 2008 4:53 am

Dear xor,

First up all, thanks for the reply.

I refer the VB example by Jan Axelson from lvr.com. No doubt It is really helpful. We can learn most of important functions from that application for that I must thanks to Jan.

But unfortunately this function is not get illustrated there. That is why I post here.

Once again Thanks to you and Jan.

Regards,

Philtkp
Posts: 90
Joined: Thu Oct 18, 2007 3:33 am
Location: Tucson AZ

Post by Philtkp » Wed Jul 23, 2008 2:52 pm

I don't know if you found any additional information on hidd_getmanufacturerstring. Jan Axelson pointed me to these

The samples are in VB and VC (Display HID and Display USB)

Post Reply