[fpc-devel] Win CE CreateFile

2015-10-19 Thread Carsten Bager
Hi

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.

Carsten
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Win CE CreateFile

2015-10-19 Thread Yury Sidorov

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.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel