C# USB Application

  • Thread starter Thread starter Alex Egg
  • Start date Start date
A

Alex Egg

Ok, i'm about to start a C# program to interface a board a friend
made. In order to do this; I need the DDK, to make a driver in C++ for
the custom board, then PInvoke it, inside of my C# app. Correct?

PInvoking the driver dosn't sound right... Does anybody have some
incite?
 
You're on the right track. If you're making the driver for the device, then
you have the option of how to do the interface. If it makes sense, look at
the serial port stuff. If you create a USB driver for your device that
emulates a serial port then your device would be accessible by anything that
can talk with serial ports. If you don't want to provide this kind of
access, you can make a custom driver and provide a set of APIs to read
from/write to/configure/monitor the device.
 
Ok, then let's see here. I don't think I want to do the serial port thing; I want to do it all USB. So, I make my custom driver for the board and then make a custom set of APIs for IO to the device

By "custom set of APIs" you mean like... An unmanaged C++ .dll that has the "read from/write to/configure/monitor/" functions in it. Then I call those unmanaged C++ functions from my managed C# app using PInvoke. Correct

I think i'm geting this correctly.
 
Yes, you'd make your unmanaged DLL that provides access to your device and
use the DLLImport stuff so you can use it from .NET.

--

Alex Egg said:
Ok, then let's see here. I don't think I want to do the serial port thing;
I want to do it all USB. So, I make my custom driver for the board and then
make a custom set of APIs for IO to the device.
By "custom set of APIs" you mean like... An unmanaged C++ .dll that has
the "read from/write to/configure/monitor/" functions in it. Then I call
those unmanaged C++ functions from my managed C# app using PInvoke. Correct?
 
Back
Top