Page 1 of 1

VB.net USB HID Program

Posted: Sun Nov 08, 2009 2:23 am
by gramo
I made a program that uses the mcHID.dll library (similar to the VB5 code produced by SF), though it works with VB.net (framework 4, can be rolled back if need be)

Image

As it stands now, iHID is a USB HID report manager. Allows you to connect to the desired device and view incoming reports, state changes and send reports.

Downloads can be found on this page

Posted: Sun Nov 08, 2009 9:04 am
by Steven
That's a great contribution - thanks. I've registered on your site to download it, but the link to download the source code is not working for me. The mcHID download works OK, but not the source code.

Posted: Sun Nov 08, 2009 9:19 am
by gramo
Not sure what happened there Steve, I've updated the file just in case.

Is it accessible now?

Posted: Sun Nov 08, 2009 9:31 am
by Steven
That's great thanks Graham, it's downloaded OK now. Thanks for sorting it out so fast.

Posted: Sun Nov 08, 2009 11:03 am
by gramo
Updated the source code with a few more comments should you find your self wondering what's going on

Posted: Sun Nov 08, 2009 12:18 pm
by Steven
Thanks for doing that.

Re: VB.net USB HID Program

Posted: Sat Sep 20, 2014 1:08 pm
by hniekus
I made a program based on this. It worked fine in Windows 7 and 8.
After the update to windows 8.1 the mcHID.dll does not work anymore.
Does somebody have a solution?

Thanks

Hans Niekus

Re: VB.net USB HID Program

Posted: Sat Sep 20, 2014 8:07 pm
by bitfogav
Is the version of windows 8.1 32bit or 64bit? I know that mcHID.dll only supports 32bit..

Re: VB.net USB HID Program

Posted: Sun Sep 21, 2014 6:48 am
by hniekus
Thanks for your replay

I do use a 32 version. It stopt after the upgrade from 8.0 to 8.1.

I do not get a message it just hangs. So it gets lost in unmanaged code (dll).
Simple tasks that only need the mcHID.dll, such as register the USB device and asking the serial number, work. When the user32.dll get involved, than it does not work.
I did see that the user32.dll (also used here) is much larger than in Windows 8.

Re: VB.net USB HID Program

Posted: Sun Sep 21, 2014 10:53 am
by Coccoliso
You did not specify if the NET compiled program is in x64 or x86 mode.
In Visual Studio you can set whether to generate an assembly for the x86 or x64 .. if the DLL can only work in x86 then you have to compile the VB program in x86 mode.
A 32 bit system work correctly and when use it on a windows x64 it will run under WOW64 and everything should work without problems. In VS2010 to set the correct x86/x64 generation of the program you have to go into the property of the project and in the Compilation tab at the top select the x86 platform.

Re: VB.net USB HID Program

Posted: Sun Sep 21, 2014 1:26 pm
by hniekus
Everything worked fine until the 8.1 update came via the windows update a year ago.
After that I switched from 2010 to Visual basic express 2013. I also did set the x86.
Nothing helped.
I do use the 32 bit version of windows.
The problem is in the mcHID.dll. That cannot communicate with the new user.dll of windows 8.1 ?
As I mentioned before : Simple tasks that only need the mcHID.dll, such as register the USB device and asking the serial number, work. When the user32.dll get involved, than it does not work.
I do not know how to repair that. I did not write that. Is there a newer version?
Or am I the only one that is having problems with windows 8.1 ???

Re: VB.net USB HID Program

Posted: Sun Sep 21, 2014 3:57 pm
by Coccoliso
Probably MS has changed the management of USB at level permissions, since it is the USER.DLL to manage it.
I saw on the net that you're not the only one having this problem with USB and this DLL in W8.1 and does not seem to have found the solution.
The only thing that comes to mind is to try to run the program as administrator in compatibility mode with a lower system type like W7 or XP ( if in W8.1 still exists the possibility ).
I'm sorry I have not upgraded to 8.1 because already in version 8.0 I had found very inconvenient to use the mouse and do not have a touchscreen.

Re: VB.net USB HID Program

Posted: Mon Sep 22, 2014 4:30 pm
by hniekus
As administrator and compatibility mode, I tried them without success.
Next year Windows 9 is coming. Windows 7 is support is stopping in 2020. That looks far away.
I wold be nice that the mcHID.dll will also work on the newer versions of Windows (8.1 and up).
The source of that DLL is available. I hoped someone could look into that?
The original link does not work, I do have a copy :
http://www.sysanalyser.com/dl/iHID_VB2008.zip
It is a great DLL.

Re: VB.net USB HID Program

Posted: Mon Sep 22, 2014 10:46 pm
by Coccoliso
Hello,
I looked at the source you posted and I saw that in the wrapper of mcHID.dll (which do not have the source code, at least in the zip) refers to the functions CallWindowProc, SetWindowLong and DelegateSetWindowLong who are in the infamous User32.dll
I think we should refer to the call of these 3 functions occurring in MSDN for W8.1 if something has changed.