John,
I am guessing you are John Dekker from the Microchip forum who posted the following: (If not, I'm sorry.. ignore the following)
http://www.microchip.com/forums/tm.aspx?m=335536I have been using your modified version of the eegeek.net C# bootloader application, which I got the source for here:
http://www.microchip.com/forums/tm.aspx?m=342162I see you've updated your application to use the newer generic_hid_cs version instead of the original C# port from Gordon Vance. I too am in the process of doing the same. It seems you ran into the same problems I am. I attempted to integrate the changes in the latest generic_hid_cs version into my application (which is based on your application), and as far as I can tell, all references to the windows API have been corrected, but I keep running into problems. After integrating everything as close as I could tell, I was getting an InvalidOverlappedtoPinvoke. This was strange because I don't get this on the generic_hid_cs application, so I'm definitely missing something.
I tried changing ReadFile to use a NativeOverlapped structure instead of the nonManagedOverlapped one. This change fixed the exception, but ReadFile still isn't returning anything.
Anyway, you said you had issues with "changing devices on the fly" and "nulling the previous interface." I'm guessing this is my issue as well. Could you please post an updated version of your C# bootloader application? If that is not feasible, perhaps you could just post parts of it? I've been beating my head against the wall for about a day now, and I'm about to refactor the whole application to work with the generic_hid_cs library instead of the original one (which I am not looking forward to).
By the way, your bootloader application and firmware are exceptional. I've modified it quite a bit, but it made for a great starting point. I have never found a bootloader setup that was this well put together on both the PC and firmware side.
Joe Dunne