[fpc-devel] Win CE CreateFile

Yury Sidorov jura at cp-lab.com
Mon Oct 19 17:07:34 CEST 2015


On 10/19/2015 4:20 PM, Carsten Bager wrote:
> The function system.CreateFile sometimes return a negative value (LongInt) under Win CE
> when used together with COM ports.
> When I typecast to LongWord everything works.
> Is it ment to be that way.

Of course a negative value of type LongInt becomes positive value when 
type casted to LongWord.
You need to inspect GetLastError to find out why CreateFile fails.

Yury.



More information about the fpc-devel mailing list