Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Hans-Peter Diettrich Newsgroups: comp.lang.pascal.delphi.misc Subject: Re: Delphi D4: using pointers to transfer data from COMM queue to circular queue Date: Fri, 19 Aug 2016 12:27:25 +0200 Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net BZSOxuSJKxQsjLJAsnVFUQnXCzjvla4jiESHo5OAGM8SdAE0Nx Cancel-Lock: sha1:Cl338JI0pohPFzN8k9qCRIBXAzc= User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: Xref: csiph.com comp.lang.pascal.delphi.misc:717 P E Schoen schrieb: > I have an application that uses a serial port component to read and > write data through a USB serial port at 57.6 kb. Originally I used the > SerialNG component and with some tweaking I was able to get it to work > reliably. But it has problems with Win10, so I changed the code to use > ComDrv32, which works when used in a simple TTY demo. I don't remember what prevented programs from using the asynchronous I/O API. 57kbd also doesn't look like a dangerous transmission speed. > I had to use a separate PChar pointer RecdPtr, and I also had to use an > integer for the pointer arithmetic. Apparently Delphi does not allow > RecdPtr := RecdPtr + (DataSize - (MAXCOMM-CommBufferPtr) ); RecdPtr + n > is OK. I'm not sure if I could just advance the DataPtr in the same way, > since it is declared as a generic Pointer type. Delphi allows pointer math only with PCHAR. At least I'd use Cardinal instead of Integer, in a workaround. DoDi