Click here to Skip to main content
15,922,166 members
Home / Discussions / C#
   

C#

 
GeneralRe: LEXICAL ANALYSIS (its urgent)!! Pin
sana1716-Aug-07 10:05
sana1716-Aug-07 10:05 
GeneralRe: Thread has Bad Karma! Pin
Martin#13-Aug-07 23:35
Martin#13-Aug-07 23:35 
GeneralRe: Thread has Bad Karma! Pin
J4amieC13-Aug-07 23:57
J4amieC13-Aug-07 23:57 
GeneralRe: Thread has Bad Karma! Pin
Pete O'Hanlon14-Aug-07 0:10
mvePete O'Hanlon14-Aug-07 0:10 
GeneralRe: Thread has Bad Karma! Pin
Martin#14-Aug-07 0:17
Martin#14-Aug-07 0:17 
GeneralRe: Thread has Bad Karma! Pin
Colin Angus Mackay14-Aug-07 0:24
Colin Angus Mackay14-Aug-07 0:24 
GeneralRe: Thread has Bad Karma! Pin
Martin#14-Aug-07 0:26
Martin#14-Aug-07 0:26 
QuestionWinUSB.dll help urgently needed Pin
2k1Toaster13-Aug-07 21:43
2k1Toaster13-Aug-07 21:43 
Hello everyone. I am having quite a problem with this. I am developing a project board that uses a Microchip PIC, and up until now I was using the general Microchip provided dll along with some snippets of code I bunched together. All I needed was a way to send 64bytes of data out and receive 64 bytes of raw data. That is it. That is still all I need.

If you want to jump ahead to the problem look for "===========PROBLEM===========" below... Otherwise this is the full story.

The problem is that Vista does not play nice with this dll. So I am forced to use WinUSB which is fairly new and very little documentation I can find. And to compound the situation, the little code I find, is all written for C++ or contained in header files.

I need to get this working in C#, and I need to do it soon. If anyone can help I would greatly appreciate it.

From my understanding I need to first crete the inf file, with the correct co-installers as well as a unique GUID. This I have already done and it is successfully recognized by Vista and XP.

Then in my program I need to search the registry for a particular GUID (the general USB hub for some reason), and then iterate through each one found until I find one that contains my vid/pid in its description using SetupDiGetClassDevs and SetupDiEnumDeviceInterfaces from the setupapi.dll. I believe I have this working as I can iterate through and find my device.

Then I need to Create a file of some sort to interface with. From my searching I found this is what I should use: Intptr TheWindowHandle = CreateFile(strPath, GENERIC_READ | GENERIC_WRITE, 0, IntPtr.Zero, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, IntPtr.Zero);

Then I must initialize this file by passing in the IntPtr I get with that, to WinUsb_Initialize which spits out some other IntPtr. I take that pointer and call WinUSB_WritePipe and WinUSBRead_Pipe.

I have no way of really knowing if I have this correct unless someone is to chime in and support this. My problem though is this:

===========PROBLEM===========
I do not know how to declare the [DllImport] of winusb.dll for WinUsb_WritePipe and WinUSB_ReadPipe nor what values they take or return.

I would gladly appreciate any and all help on this and specifically C# examples. If you are willing to write the small snippet of code needed, I can compensate you for it. If you need any more information about my source code or the winusb dll or the application, just let me know.

I thank everyone in advance for the help.
AnswerRe: WinUSB.dll help urgently needed Pin
bader26-Oct-10 22:49
bader26-Oct-10 22:49 
QuestionEmbedding a picture Pin
steve_rm13-Aug-07 21:24
steve_rm13-Aug-07 21:24 
AnswerRe: Embedding a picture Pin
Giorgi Dalakishvili13-Aug-07 22:09
mentorGiorgi Dalakishvili13-Aug-07 22:09 
AnswerRe: Embedding a picture Pin
Martin#13-Aug-07 22:36
Martin#13-Aug-07 22:36 
QuestionHowto Start a form in a thread and get access to it's variables Pin
Ariadne13-Aug-07 21:19
Ariadne13-Aug-07 21:19 
AnswerRe: Howto Start a form in a thread and get access to it's variables Pin
Martin#13-Aug-07 21:39
Martin#13-Aug-07 21:39 
GeneralRe: Howto Start a form in a thread and get access to it's variables Pin
N a v a n e e t h13-Aug-07 23:00
N a v a n e e t h13-Aug-07 23:00 
GeneralRe: Howto Start a form in a thread and get access to it's variables Pin
Martin#13-Aug-07 23:04
Martin#13-Aug-07 23:04 
GeneralRe: Howto Start a form in a thread and get access to it's variables Pin
Ariadne14-Aug-07 2:43
Ariadne14-Aug-07 2:43 
GeneralRe: Howto Start a form in a thread and get access to it's variables Pin
Martin#14-Aug-07 2:54
Martin#14-Aug-07 2:54 
GeneralStart new thread Pin
Ariadne14-Aug-07 3:27
Ariadne14-Aug-07 3:27 
GeneralRe: Start new thread Pin
Martin#14-Aug-07 3:33
Martin#14-Aug-07 3:33 
QuestionFonts In PDF Pin
Belju Paul13-Aug-07 20:54
Belju Paul13-Aug-07 20:54 
QuestionText changed property Pin
Ravi Shankar4313-Aug-07 20:44
Ravi Shankar4313-Aug-07 20:44 
AnswerRe: Text changed property Pin
Christian Graus13-Aug-07 20:53
protectorChristian Graus13-Aug-07 20:53 
GeneralRe: Text changed property Pin
Ravi Shankar4313-Aug-07 21:17
Ravi Shankar4313-Aug-07 21:17 
Questioncrystal Report Problem Pin
help as an alias13-Aug-07 20:40
help as an alias13-Aug-07 20:40 

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.