Converting C++ header file to Delphi4 pas unit

From: fabrizio (fabrizio_dagnolo_at_hotmail.com)
Date: 01/24/04


Date: 24 Jan 2004 02:46:28 -0800

Hi,

I connected a microcontroller, ATMEGA16 from ATMEL, to the RS232 Port of
a desktop PC, COMPAQ deskpro Pentium 2.
On the PC i wrote a Delphi4 application using the Asyncpro ADPCOMPORT component.

I made a looptest program to see what the error rate is on the RS232 link.
PC sends command to the Device, device answers with a predefined string.
On the PC i check if the string is received correctly.
Quit some errors are seen on the received strings from the Controller.
8 faults on 1000 calls. All the received strings have missing characters in the
middle and towards the end of the string.

When i run hyperterminal on the PC, NO errors are seen.
This means that the Device is sending out the strings correctly.

In delphi application the Ontriggeravail event is used. And the number
of bytse indicated in the Count variable in Loop. I check on the CHR(13) to see
when all characters are received. If TRUE the received string is processed.

I suspect the APDCOMPORT component loosing characters !!!!

Therefore i received another component written in C++. TSERIAL.DLL
DLL Header and library file are also provided.

Know i have to translate the Header file into a Pascal Unit, to be able to use
the TSERIAL DLL in Delphi4.

I don't have any experience with this. In analogy with a previous DLL i
write the Tserial.Pas file.

However when compiling the File i receive the error that there procedure entry
point (the procedure that is specified in the Tserial.Pas file, can NOT be
located in the TSERIAL.DLL

And here i am Stuck.

Can somebody help me out on this problem.

If somebody is willing to help me i will send the Delphi project directly by mail.

Kind regards,
Fabrizio,



Relevant Pages

  • Re: Converting C++ header file to Delphi4 pas unit
    ... > On the PC i wrote a Delphi4 application using the Asyncpro ADPCOMPORT component. ... > PC sends command to the Device, device answers with a predefined string. ... > Quit some errors are seen on the received strings from the Controller. ... > DLL Header and library file are also provided. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Converting C++ header file to Delphi4 pas unit
    ... I Flush the Delphi component Input buffer on initialisation. ... >> PC sends command to the Device, device answers with a predefined string. ... >> Quit some errors are seen on the received strings from the Controller. ...
    (comp.lang.pascal.delphi.misc)
  • Re: StrUpper function in D4 seems broken
    ... No mods have been made, it's a fresh install of delphi4 with service packs 1,2,3 applied. ... I get an memory access violation with the code below. ... PUSH ESI ... It maybe possible that the string is being allocated in Read ...
    (alt.comp.lang.borland-delphi)