Using the WinUSB driver with Delphi 7 applications [Edit]

I have just discovered the generic Microsoft USB driver described here: http://www.microsoft.com/whdc/connect/usb/winusb_howto.mspx
(I hope this comes out as a link, it does not when I view it using the Preview function...)

Of course the document is just describing how to use it from C++, which I am not at all used to.
Is there anyone here who has touched on this WinUSB who can direct me on how to use it from Delphi?

Apparently the idea here is to use the generic driver WinUSB to talk to a device directly from an application. The device will not be able to talk to the operating system itself, just to the special application.
This is exactly what I want since we are developing embedded systems (using ARM based MCU:s) and are now looking at the USB communication rather than RS232, which has been the past method.
The data we shuffle is special for our boards and so it fits to have an application that handles it in Windows.

I am responsible for making that happen on the PC side using Delphi, but I have some problems with the MS documentation. Hopefully some other developer has pioneered this so they can help out...
0
Bo
6/1/2010 9:11:14 AM
embarcadero.delphi.win32 2183 articles. 0 followers. Follow

1 Replies
2317 Views

Similar Articles

[PageSpeed] 4
Get it on Google Play
Get it on Apple App Store

On 01/06/2010 5:11 AM, Bo Berglund wrote:
> I have just discovered the generic Microsoft USB driver described
> here: http://www.microsoft.com/whdc/connect/usb/winusb_howto.mspx (I
> hope this comes out as a link, it does not when I view it using the
> Preview function...)
>
> Of course the document is just describing how to use it from C++,
> which I am not at all used to. Is there anyone here who has touched
> on this WinUSB who can direct me on how to use it from Delphi?
>
> Apparently the idea here is to use the generic driver WinUSB to talk
> to a device directly from an application. The device will not be able
> to talk to the operating system itself, just to the special
> application. This is exactly what I want since we are developing
> embedded systems (using ARM based MCU:s) and are now looking at the
> USB communication rather than RS232, which has been the past method.
> The data we shuffle is special for our boards and so it fits to have
> an application that handles it in Windows.
>
> I am responsible for making that happen on the PC side using Delphi,
> but I have some problems with the MS documentation. Hopefully some
> other developer has pioneered this so they can help out...

Well it's two steps:
1. Create an INF that installs WinUSB as the driver for your
    USB device. Make sure the device is installed and shows up.
2. Use the WinUSB API to access the device.
Are you stuck at #1 or #2?

Note that "The device will not be able to talk to the operating
  system itself, just to the special application." is not
  really accurate. The OS does a lot of the work along
  with the WinUSB driver and between them they do all the
  communication. Now deciding what to send and what do
  to with anything received (the work that makes it all
  do something useful) would be in the Delphi application.

Brian
0
Brian
6/17/2010 2:16:05 PM
Reply:

Similar Artilces:

I wrote an application and used cracked delphi 7, after i bought delphi 7
I wrote an application and used cracked delphi 7, I sold it, after i bought delphi 7 and recompiled application, is now my application legal or? > {quote:title=Ivan Ivanov wrote:}{quote} > I wrote an application and used cracked delphi 7, I sold it, after i bought delphi 7 and recompiled application, is now my application legal or? "I embezzled some money from my employer, returned the funds, and then got it back as a bonus. Can I still be arrested?" Uhhh .... didn't you just confess to a crime? > {quote:title=Ivan Ivanov wrote:}{quote} > I wrote an appli...

How to import *.jar to Win32 Application (Delphi 7) [Edit]
Hi all. Please I need help. I need some way to call *.jar from Win32 application to use its methods. This jar working in a following way: I should push as parameter xml file and jar program will return pdf file. Previously I was using ShellExecute to pass xml as parameter, xml was small. But I hit problem - error 'input line is to long'. Basically xml now to big - error caused by Windows command line limit. I started realizing that I need some way to import jar as class to my project like I can do with Ac tiveX or some way convert jar to dll. I have seen in internet JNI project where ...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

Convert Delphi 7 to Delphi 2009 [Edit]
Hi! Please, I have a code done in Delphi 7... Now I want to convert Delphi 7 to Delphi 2009 but I'm having problems when compile the code. Error message: +[DCC Fatal Error] Far.dpr(9): F2063 Could not compile used unit 'System.pas'+ Please can somebody help me? Source Download (349KB): http://rapidshare.com/files/256191328/FileManager.rar.html Mirror Source Download: http://www.megaupload.com/?d=12GYLPT0 Password: delphi Thank u so much! (sorry for my bad english, it is not my native language) Edited by: loquax loquax on Jul 15, 2009 12:24 PM Sorry, bu...

delphi Win32 using delphi .NET dll
Hi, I'm trying to use a delphi.NET dll in delphi.WIN32. I am currently using CodeGear Delphi 2007 with version2(base version) of .NET I can get the dll to import into the WIN32 application the only problem is when i include things such as: "using Classes,DateUtils, SysUtils" in the .NET dll the win32 application will instantly hang when any of the dll functions are called. Any help would be great thanks. Also I have tried this example and it also crashes for me? http://cc.embarcadero.com/Item/22688 -Braden I also found this.. "The problem is that, wehn you instal...

Delphi.NET loading Delphi.Win32 Driver
Hi, What I'm trying to do is marshal an array of cardinal (or integer) back into managed memory from a win32 dll. I know how to pass managed memory into a win32 dll {code} var aa : array of Integer; Buffer : IntPtr; begin SetLength(aa,2); aa[0] := 1; aa[1] := 80; if not Supports(ExtractFilePath(Application.ExeName)+'Win32_Library\SDK_Driver.Win32.io', TypeOf(IMyFunctions), MyFunctions) then Exit; //loads the driver into memory. MyFunctions contains the method names found in the SDK_Driver. Buffer := Marshal.AllocHGlobal(2 * {Marshal.SystemDefaultC...

Cannot use Microsoft Excel when a Delphi application that uses automat. run [Edit]
Dear all, I built an application that connect to an Excel file using a OleObject: Excel := CreateOleObject('Excel.Application'); LCID := GetUserDefaultLCID; all works fine but I cannot use Microsoft Excel externally when my application is running. If I try to open another xls file, Excel tries to open the file in my Delphi application in read only mode. It does not even show it properly but opens a weir transparent application. I just want to be able to use Excel externally and I'd like the instance opened by my Delphi application to be independent from other Exc...

Problem using InstallAware 7 CodeGear Special Edition with Delphi 2010 [Edit]
Hi Everyone, I am trying to create an installation disk for my delphi 2010 application using the installAware that kind of comes with Delphi 2010. When I try to built it, it keeps giving me the error message:- No files matching pattern "C:\Windows\system32\\*120.bpl" and when I look into my windows\system32 folder, there the files with extension *.bpl end with *140.bpl and not *120.bpl like it was expected. Can anyone tell me if I am doing something wrong or how I can get around this. Thanks in advance. Edited by: Tat Hon Chu on Dec 3, 2009 12:55 AM > {quo...

Code works in Delphi 7 but not in Delphi 2010 [Edit]
hello, i have a procedure that open's a file by passing the file name as the parameter to the executable. something like this {code} C : \ P r o g r a m F i l e s \ Da c k e r \ D r a c k e r . e x e " G : \ D E l p h i 7 \ D e l p h i 7 A p p _ l o g . t " {code} The source code is {code} procedure OpenFileWithExe var hReg: HKEY; Ret: Longint; RegDataType, RegDataSize: DWORD; CmdLine: array [0..560] of Char; Len: Integer; SInfo: TStartupInfo; PInfo: TProcessInformation; begin Ret := windows.RegOpenKeyEx(HKEY_CURRENT_USER, ...

Delphi 7 to Delphi XE: TBlobField to XML [Edit]
Hi, I'm migrating a Delphi7 application to Delphi XE. I'm using a TClientDataSet to communicate, by using a XML frame, with my server. In this TClientDataSet I'm using a TBlobField which is an array of 384 byte. The blobField is allocate by a code like this : {code} myStream : TStream; myStream := aClientDataSet.CreateBlobStream(myBlobField, bmwrite); vResult := myStream.Write(ArrayOf384Byte[0], length(ArrayOf384Byte)); //vResult = 384 => GooD ! (...) {code} For communicate with the server, we have to decode the Blobfield in XML before to sending it. We have...

Win32 program: Delphi 7 vs Delphi XE5
How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability and performance? Is Delphi XE5 good enough for a big ERP project with several DLL's and hundreds of units and forms? Thanks in advance Am 26.12.2013 15:02, schrieb lior ilan: > How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability > and performance? > Is Delphi XE5 good enough for a big ERP project with several DLL's and > hundreds of units and forms? > Thanks in advance > Hello, XE5 has increased functionality. Stability seems to be ok for most ...

Win32 Delphi language features introduced since Delphi 7
Hi, Am I right in thinking that the language features introduced since Delphi 7 fall into the categories: a) language features dictated by .Net compatibility. e.g. Namespaces, Inlining, records with methods, operator overloading, pure interfaces, generics, extended RTTI and reflection; b) Unicode strings and supporting procedures? c) 64-bit support What other language features, if any, have been introduced since D7? Had most of the post-D7 languages features, except for generics, Unicode strings, and 64-bit support, been introduced in or before Delphi 2005? How bug-free were ...

ActiveX differences between Delphi 7 and Delphi XE4 in an MFC application
When I create an ActiveX control based on a TPanel (with no added code) in Delphi 7, I am able to add this to a MFC C++ application and have it run fine. When I take the exact same code and compile it in Delphi XE4 (and XE2), MFC throws an assertion. I confirmed that the only changes are in the dcu, ocx and res files. The assertion is happening on ASSERT(wFlags == DISPATCH_METHOD); in occsite.cpp (I included the source to this). {code} STDMETHODIMP COleControlSite::XEventSink::Invoke( DISPID dispid, REFIID, LCID, unsigned short wFlags, DISPPARAMS* pDispParams, VARIANT* pvar...

ANN: The free to use kbmMW 3.51.00 CodeGear Edition and kbmMemTable v. 7.00.01 Beta 1 CodeGear Edition for Delphi XE, has been released!
We are happy to announce the immediate availability of the free to use kbmMW v. 3.51.00 CodeGear Edition and kbmMemTable v. 7.00.01 CodeGear Edition for Delphi XE! The keywords for this release are: - Delphi XE support - Highly optimized performance in master/detail and ranges in kbmMemTable. - New GroupBy function in kbmMemTable. - Improved support for fielddefinitions with data, even in master/detail relations - Performance enhancements - Multithreading enhancements - Dataset enhancements - Stability enhancements and bugfixes Remember the free kbmMemTable CodeGear Edition ...

Web resources about - Using the WinUSB driver with Delphi 7 applications [Edit] - embarcadero.delphi.win32

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Welfare experiment may have applications in Australia
A trial in Finland providing an obligation-free basic income could change how we think about welfare.

AVO application against Labor's Jamie Clements withdrawn
An application for an apprehended violence order against Labor powerbroker Jamie Clements - based on allegations he tried to kiss a female staffer ...

Patent application shows Apple Watch band that transforms into a case, stand and Mac accessory
An Apple patent application published today reveals an idea for an interesting variation on the magnetically-closed Milanese Loop band that allows ...

Seagate Introduces First 8 TB Hard Disk Drive for Consumer NAS Applications
Seagate Technology on Tuesday introduced its new breed of hard disk drives (HDDs) for network area storage (NAS) and RAID applications. The new ...

MBA: Mortgage Applications Increased in Latest Weekly Survey, Purchase Applications up 19% YoY
From the MBA: Mortgage Applications Increase in Latest MBA Weekly Survey Mortgage applications increased 21.3 percent from one week earlier, ...

Mortgage applications sink after rush
A Fed rate hike pulled mortgage demand forward, and made for a steep drop-off in the past two weeks.

SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika
SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika

In Application To Move To Los Angeles, Rams Shit All Over City Of St. Louis
... to relocate to the greater Los Angeles metropolitan area. The relocation would be effective for the 2016 NFL League Year.” The Rams’ full application ...

Seagate pushing non-PC storage for 2016 with focus on surveillance applications
... products for cloud computing, consumer electronics, surveillance and enterprise storage for 2016. Seagate expects surveillance-related applications ...

Resources last updated: 1/17/2016 7:10:19 AM