USB HID Library

Developed or developing a new product in PureBasic? Tell the world about it.
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: USB HID Library

Post by User_Russian »

Checked with PB 5.22 x64. Works great (compile without errors).
Maybe you incorrectly installed library "HID Lib".

You can use the HID module.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

User_Russian wrote:What version of PB and libraries?
Very similar to what PB version 5.2x, and a library for the previous version.
Library for 5.2x.
x86.
x64.

You can also use HID module ("USB HID Library" is not needed). http://purebasic.mybb.ru/viewtopic.php?id=471
I have re-downloaded the x64 file you linked to and installed it both in PureBasic\PureLibraries\ and in PureBasic\PureLibraries\UserLibraries. Same problems with the example files. Are these the correct locations? I have not changed anything from the downloaded .zip files, other than to unzip them. Can you explain why they don't work?
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: USB HID Library

Post by User_Russian »

Works for me.

Need to unpack the archive directory where you installed PureBasic.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

Maybe you incorrectly installed library "HID Lib"
What is the correct way to install this library?
Need to unpack the archive directory where you installed PureBasic.
Forgive me for asking, but how do I do this? PureBasic works fine. I have unzipped the .zip files if that's what you mean by "unpack the archive directory".
installed it both in PureBasic\PureLibraries\ and in PureBasic\PureLibraries\UserLibraries
Last edited by chris319 on Fri Aug 08, 2014 10:19 am, edited 1 time in total.
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: USB HID Library

Post by User_Russian »

Need to unpack the archive with library, in directory where you installed PureBasic. http://www.purebasic.fr/english/viewtop ... =5&t=15467

If you have any difficulties with the installation of the library, use the "HID module". http://purebasic.mybb.ru/viewtopic.php?id=471
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

The real command library from the respective archive must be copied into the directory PureBasic\PureLibraries\UserLibraries\. After the next restart of the PureBasic editor the included commands will be recognized and can be used for programming.

If predefined constants (in a .res file) are included in the archive, this file must be copied into the directory PureBasic\Residents\.
This is EXACTLY what I have done and your four test programs still don't compile and link.
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: USB HID Library

Post by User_Russian »

I repeat once more. Need to unpack the archive with library, in directory where you installed PureBasic.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

I uninstalled and reinstalled all USB HID files.

PB is finding HID_Lib, which is installed in PureBasic\PureLibraries\UserLibraries. A restart of PB is required for this library to be found.

DeviceTest.pb compiles and runs

Device_IO.pb: compiles and runs

DeviceInfo.pb: "Structure not found: HID_Lib_DeviceInfo

USB_Termo.pb: "Icon file not found"

So we are making progress. Thank you for your help so far.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

Please disregard.
Last edited by chris319 on Sat Aug 09, 2014 1:31 am, edited 2 times in total.
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: USB HID Library

Post by User_Russian »

chris319 wrote:DeviceInfo.pb: "Structure not found: HID_Lib_DeviceInfo
File HID_Lib_Res.res is located in folder Residents?
chris319 wrote:USB_Termo.pb: "Icon file not found"
In the menu, Compiler, select Compiler Options and uncheck Use Icon.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

In the menu, Compiler, select Compiler Options and uncheck Use Icon.
This results in the error: "The specified ImageID is NULL." (Termo.pb)
AddSysTrayIcon(1,WindowID(0),ExtractIcon_(0,ProgramFilename(),0)) ; Èêîíêà â òðåå
File HID_Lib_Res.res is located in folder Residents?
That fixed the problem in DeviceInfo.pb, thank you.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

Translated versions can be found here: http://www.purebasic.fr/english/viewtop ... 15#p359538
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: USB HID Library

Post by User_Russian »

chris319 wrote:This results in the error: "The specified ImageID is NULL." (Termo.pb)
Error due to lack of the icon file.
In the folder with USB_Termo.pb, there is a file Значок.ico. Rename it to Icon.ico and use in the project.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: USB HID Library

Post by chris319 »

In the folder with USB_Termo.pb
That would be the folder named Examples\Hid_LIB\USB_Termo. No need to keep it a secret.

To what should I rename the file æsѼá_USB_Termo.GIF?
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: USB HID Library

Post by User_Russian »

chris319 wrote:To what should I rename the file æsѼá_USB_Termo.GIF?
Rename it is not necessary. It is not used in the project. This electrical circuit thermometer device.
The original name Схема_USB_Termo.gif. You can rename it to Circuit_USB_Termo.gif.
Post Reply