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 don't want to take the trouble to port the code to another development platform, but if it has much meaning for you, these are the point.
- The code is written for MS VC++ with MFC - The code requires HID and SetupDi- header files and library
I've heard recent C++ builder supports MFC, but not sure. Ask it on this forum,
borland.public.cppbuilder.ms_compatibility groups.google.com/.../topics As of HID and SetupDi- header files and library, Officially, these files are included in WinDDK. Free WinDDK (Server 2k3 SP1 DDK) is downloaded from MS
"DDK - Windows Driver Development Kit" from MS WHDC www.microsoft.com/.../default.mspx Find "Download the Windows Server 2003 SP1 DDK [236 MB ISO file]" link
OR
On the Intel Press site for the book, "USB Design by Example", you'll find an excerpt of HID files from Win2K DDK. :-)
FromDDK.zip www.intel.com/.../FromDDK.htm
Tsuneo
Tsuneo, these are the errors I get... Do you know what could cause this?
D:\WINDDK\3790.1830\inc\mfc42\afxres.rc(152) : error RC2135 : file not found: res\help.cur D:\WINDDK\3790.1830\inc\mfc42\afxres.rc(171) : error RC2135 : file not found: res\3dcheck.bmp D:\WINDDK\3790.1830\inc\mfc42\afxres.rc(194) : error RC2135 : file not found: res\minifwnd.bmp D:\WINDDK\3790.1830\inc\mfc42\afxres.rc(199) : error RC2135 : file not found: res\ntcheck.bmp D:\WINDDK\3790.1830\inc\mfc42\afxres.rc(200) : error RC2135 : file not found: res\95check.bmp
Now, what could the probable causes be that a compiler fails to find files? Care to take a guess?
- That you don't have any files with that name on your hard drive? - That you have the files, but that you haven't instructed the tool to process that specific directory? - That you have the files, but have specified any access rights that forbidds the compiler from accessing them (not too common problem on Win32 machines)
So, time for you to start figuring out why you get these error messages, since we can not guess what files you have in your machine or where they are stored or where you have allowed the compiler to search...
I have the files on my machine. But I don't know where to include .bmp files. I have tried putting them on the folders that are included on the vc++ directories but that didn't work.
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 !
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.
My C++ Builder v5 - which is pretty old now - supports MFC...
I think the same can be said of any example code - not just USB!
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.
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?
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.
"I wonder if this specific example doesn't work with vc++ 2008 express edition."
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.
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.
Does anybody know a software to test my win application? Not a sniffer but something that would emulate the hid device?
Unfortunately, Express edition doesn't support MFC. Just .Net FrameWork.