Hello, I have bought the Keil development tool for mcb2148 and I'm trying to compile the HID client example that comes with it... However using borland c++ 6 I get lots of error messages. If anyone knows how to solve this please leave me a note. Thanks Doug
I'd like to document everything I did to get the HID Client to build, all in one spot.
I have installed * Visual C++ 6.0 * Visual Studio C++ 2005 Express Edition * Windows WDK, my version is 6001.18002.
For my case, both versions of Visual C++ DID need to be installed. ================================ 1. INSTALL WINDOWS WDK To start off with, you need to download the Windows Driver Kit - WDK (formerly known as the DDK).
Follow the instructions under "show/hide steps." ", select include files, then you'll need to add:
C:\WinDDK\6001.18002\inc\ddk C:\WinDDK\6001.18002\inc\api C:\WinDDK\6001.18002\inc\mfc42
Under "library files," you'll need to add:
C:\WinDDK\6001.18002\lib\atl\i386 C:\WinDDK\6001.18002\lib\mfc\i386 C:\WinDDK\6001.18002\lib\wxp\i386 C:\Program Files\Microsoft Visual Studio\VC98\MFC\Lib
The last one is a Visual C++ 6.0 path. ================================ 5. Copy some resource files. I needed to copy some contents of the following VC++ path into my project directory
copy C:\Program Files\Microsoft Visual Studio\VC98\MFC\Include\Res\*.* c:\Keil\ARM\Utilities\HID_Client\res
================================ 6. Build and execute. ================================ Good luck.
On the device I did exacly what you've said on another thread and on the host I changed the report sizes to 64 bytes.
"Also I can't get Tsuneo's idea of separating the software into blocks to work on bcb 6 with 64 byte reports, using 8 bit report works fine."
8 bit report? Isn't it 8 byte report?
Anyway, start with the working one. What do you change from the "8 bit" report to 64 byte one, the device side and the host side.
Tsuneo
"Does anybody know a software to test my win application?"
Win application? Do you mean something like HID device emulator?
For HID device test, this app will work.
On Ms.Axelson's "The HID Page", SimpleHIDWrite www.lvr.com/.../SimpleHIDWrite3.zip
"I wonder if this specific example doesn't work with vc++ 2008 express edition."
Unfortunately, Express edition doesn't support MFC. Just .Net FrameWork.
Does anybody know a software to test my win application? Not a sniffer but something that would emulate the hid device?
Bummer huh, subscription of the standard version costs something like U$1200. Also I can't get Tsuneo's idea of separating the software into blocks to work on bcb 6 with 64 byte reports, using 8 bit report works fine.
To my knowledge, the Express edition doesn't have support for MFC. It was at least missing in a previous version of the Express edition that I looked at.
I wonder if this specific example doesn't work with vc++ 2008 express edition. Maybe it was compiled with some earlier version of the software, but all I know is that it doesn't work, the closest I've got for the example were linker errors.
Tsuneo, I've done just what you told me to. I'm using 64 bytes repots just like you've explained on another post. Still I don't get outreports from my application. What could be the cause of this? Any ideas on what sort of test should I do?
Ok I'll tell you guys what I have done so far... Since where I work people are experienced with BC++ I have to use the compiler to make my application. With that said what I did was, there's a tool on the BC called "Visual C++ project conversion utility" so I used it on the HID example code from Keil. So I got an application that works fine for HID. But here comes the problem, I followed Tsuneo steps to make 64 bits in and out reports, on the arm everything works fine. I've got a sniffer looking at the packages that were being exchanged and I only get in reports. Out reports dont work with my application. How do I know that? I wrote code on the arm so it would set a led when outreport was received, then I used my sniffer to send out reports and the led was set.
I think the same can be said of any example code - not just USB!
My C++ Builder v5 - which is pretty old now - supports MFC...
You seem to get into the porting trouble of MFC (Microsoft Foundation Class). I think it is the waste of your valuable time. Rather, split out the example code into building blocks, and ignore the GUI and framework of MFC.
The essential blocks for USB handling are, - The SetupDi-APIs are used to specify the device, and to get the device handle. - USB communication is done over this device handle, using File I/O, CreateFile - ReadFile - WriteFile - CloseHandle.
These code are stereotype one, and they works either in MSVC or C++ builder without modification, because these code use just the Windows APIs directly. Plug these blocks into the framework and GUI of C++ builder.
Blind porting doesn't bring you any understanding of USB handling.
I figured it out, the /res folder didn't exist on the mfc so I created it and put the files there. It worked sorry about bugging you guys... and thanks !
View all questions in Keil forum