Forum > Windows (32/64)
how to access windows API functions
(1/1)
freepiston:
After 25 years I thought I would dust off the grey cells and try Lazarus to read a COM port via windows API calls (I used to dabble with Delphi 5).
I'm trying to use 'CreateFile' but the Lazarus compiler cannot find it so I clearly have not the right 'uses' entry. I am 73 and rather stuck in the assembler/FORTRAN world of the 60s and 70s, so please bear with me!
Jonvy:
You can use LazSerial componment, it's very easy to use,better than using windows API to read COM port.
PascalDragon:
--- Quote from: freepiston on August 22, 2022, 10:16:52 am ---After 25 years I thought I would dust off the grey cells and try Lazarus to read a COM port via windows API calls (I used to dabble with Delphi 5).
I'm trying to use 'CreateFile' but the Lazarus compiler cannot find it so I clearly have not the right 'uses' entry. I am 73 and rather stuck in the assembler/FORTRAN world of the 60s and 70s, so please bear with me!
--- End quote ---
Did you add the unit Windows to your uses-clause?
Though if you don't want to dabble with the low level stuff you should indeed follow Jonvy's advice of using some preexisting code like LazSerial or even the Serial unit provided by FPC itself (of which I think LazSerial might be a wrapper).
Navigation
[0] Message Index