Registriert seit: 9. Aug 2003
389 Beiträge
Delphi 7 Professional
|
Re: USB Port abfragen mit Delphi?
18. Jan 2006, 15:01
Code:
typedef PVOID FT_HANDLE;
typedef ULONG FT_STATUS;
FTD2XX_API
FT_STATUS WINAPI FT_Open(int deviceNumber, FT_HANDLE *pHandle);
FTD2XX_API
FT_STATUS WINAPI FT_OpenEx(PVOID pArg1,DWORD Flags, FT_HANDLE *pHandle);
FTD2XX_API
FT_STATUS WINAPI FT_Close(FT_HANDLE ftHandle );
FTD2XX_API
FT_STATUS WINAPI FT_Read(FT_HANDLE ftHandle, LPVOID lpBuffer, DWORD nBufferSize,LPDWORD lpBytesReturned);
FTD2XX_API
FT_STATUS WINAPI FT_Write(FT_HANDLE ftHandle, LPVOID lpBuffer, DWORD nBufferSize, LPDWORD lpBytesWritten);
Delphi-Quellcode:
Const
FTD2xxLib = 'FTD2XX.DLL';
Type
FT_HANDLE = PPointer;
PFT_HANDLE = ^FT_HANDLE;
FT_STATUS = DWORD;
Function FT_Open(deviceNumber : Integer;pHandle : PFT_HANDLE) : FT_STATUS; StdCall; External FTD2xxLib;
Function FT_OpenEx(pArg1 : Pointer;Flags : DWORD;pHandle : PFT_HANDLE) : FT_STATUS; StdCall; External FTD2xxLib;
Function FT_Close(ftHandle : FT_HANDLE) : FT_STATUS; StdCall; External FTD2xxLib;
Function FT_Read(ftHandle : FT_HANDLE;lpBuffer : Pointer;nBufferSize : DWORD;lpBytesReturned : PDWORD) : FT_STATUS; StdCall; External FTD2xxLib;
Function FT_Write(ftHandle : FT_HANDLE;lpBuffer : Pointer;nBufferSize : DWORD;lpBytesWritten : PDWORD) : FT_STATUS; StdCall; External FTD2xxLib;
|
|
Zitat
|