Click here to Skip to main content
15,919,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Newbie question, problem compiling Pin
Randor 14-Jul-09 9:28
professional Randor 14-Jul-09 9:28 
AnswerRe: Newbie question, problem compiling Pin
Maximilien14-Jul-09 9:30
Maximilien14-Jul-09 9:30 
AnswerRe: Newbie question, problem compiling Pin
Adassus14-Jul-09 11:41
Adassus14-Jul-09 11:41 
GeneralRe: Newbie question, problem compiling Pin
Randor 14-Jul-09 11:59
professional Randor 14-Jul-09 11:59 
GeneralRe: Newbie question, problem compiling Pin
Adassus14-Jul-09 15:44
Adassus14-Jul-09 15:44 
QuestionUSB interaction from user space. I need some light please! Pin
sinosoidal14-Jul-09 6:32
sinosoidal14-Jul-09 6:32 
AnswerRe: USB interaction from user space. I need some light please! Pin
Roger Stoltz14-Jul-09 6:59
Roger Stoltz14-Jul-09 6:59 
AnswerRe: USB interaction from user space. I need some light please! Pin
Randor 14-Jul-09 8:41
professional Randor 14-Jul-09 8:41 
Hi sinosoidal,

The DeviceIoControl Function[^] can be called directly from your C# application. There is no need to create a C++ DLL when you can pass information to and from a device driver with the C# language.

Take a look in your USB driver code and look for the IRP_MJ_DEVICE_CONTROL entry point. Should be something like:

DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = SomeFunction


This defines the function which processes IOCTL codes. All you need to do is define a new IOCTL code. You simply pass a pointer in the DeviceIoControl lpOutBuffer parameter and the device driver can write data into the buffer at this address. Its extremely simple.

I would recommend spending a few hours playing with the sample project at:
WinDDK\6001.18002\src\general\ioctl\

This will give you an idea about how simple communication with a device driver is.

If the data arriving on the USB device needs to fire an event to notify your usermode application you can view the sample located at:
WinDDK\6001.18002\src\general\event

I highly recommend investing a few hours experimenting with these samples. The C# language is full featured and there is no reason to write a native DLL if the parent application is managed. You can communicate with the device driver directly from your C# application.

Best Wishes,
-David Delaune
GeneralRe: USB interaction from user space. I need some light please! Pin
sinosoidal15-Jul-09 0:49
sinosoidal15-Jul-09 0:49 
GeneralRe: USB interaction from user space. I need some light please! Pin
Randor 15-Jul-09 8:08
professional Randor 15-Jul-09 8:08 
GeneralRe: USB interaction from user space. I need some light please! Pin
sinosoidal15-Jul-09 9:34
sinosoidal15-Jul-09 9:34 
QuestionProblem with the reading of the BMP file Pin
TeslaShock14-Jul-09 5:27
TeslaShock14-Jul-09 5:27 
AnswerRe: Problem with the reading of the BMP file Pin
Chris Losinger14-Jul-09 6:01
professionalChris Losinger14-Jul-09 6:01 
GeneralRe: Problem with the reading of the BMP file Pin
TeslaShock14-Jul-09 6:13
TeslaShock14-Jul-09 6:13 
AnswerRe: Problem with the reading of the BMP file Pin
Joe Woodbury14-Jul-09 6:38
professionalJoe Woodbury14-Jul-09 6:38 
GeneralRe: Problem with the reading of the BMP file Pin
TeslaShock16-Jul-09 5:13
TeslaShock16-Jul-09 5:13 
QuestionOnInitDialog() never be called Pin
transoft14-Jul-09 2:22
transoft14-Jul-09 2:22 
QuestionRe: OnInitDialog() never be called Pin
CPallini14-Jul-09 2:35
mveCPallini14-Jul-09 2:35 
AnswerRe: OnInitDialog() never be called Pin
transoft14-Jul-09 2:42
transoft14-Jul-09 2:42 
GeneralRe: OnInitDialog() never be called Pin
Cedric Moonen14-Jul-09 2:48
Cedric Moonen14-Jul-09 2:48 
GeneralRe: OnInitDialog() never be called Pin
transoft14-Jul-09 6:05
transoft14-Jul-09 6:05 
GeneralRe: OnInitDialog() never be called Pin
Cedric Moonen14-Jul-09 7:20
Cedric Moonen14-Jul-09 7:20 
GeneralRe: OnInitDialog() never be called Pin
transoft14-Jul-09 7:24
transoft14-Jul-09 7:24 
GeneralRe: OnInitDialog() never be called Pin
Cedric Moonen14-Jul-09 7:28
Cedric Moonen14-Jul-09 7:28 
AnswerRe: OnInitDialog() never be called Pin
Cedric Moonen14-Jul-09 2:44
Cedric Moonen14-Jul-09 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.