Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2015-10

Win CE CreateFile

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Yury Sidorov
to Carsten Bager
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.

Reply by email