[Lazarus] INVALID_* consts

waldo kitty wkitty42 at windstream.net
Mon Jun 3 11:00:46 CEST 2013


there are two items of discussion in this post...

i've some converted code that expects INVALID_FILE_SIZE but this constant is not 
found... i did some digging and find INVALID_HANDLE_VALUE in LCLType but no 
other INVALID_* constants... so i go visit uncle google and i find something 
interesting...

[1]
in Lazarus LCLType : INVALID_HANDLE_VALUE  = 0;
in synapse synaser : INVALID_HANDLE_VALUE = THandle(-1)

this link's message #10 
http://cboard.cprogramming.com/windows-programming/21261-simple-question-again.html 
shows

#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)

which seems to be in line with what synapse shows... why does LCLType define it 
as 0 instead of -1? what's up with that?


[2]
in the above link, i also find the definition of INVALID_FILE_SIZE

#define INVALID_FILE_SIZE ((DWORD)0xFFFFFFFF)

i found several references and a few of those point to MSDN

http://msdn.microsoft.com/en-us/library/windows/desktop/aa364955%28v=vs.85%29.aspx



why does this constant not exist in FPC or Lazarus? have i been looking in the 
wrong place or for the wrong thing? can we get this added to LCLType or should i 
convert it to use something else that already exists?


-- 
NOTE: No off-list assistance is given without prior approval.
       Please keep mailing list traffic on the list unless
       private contact is specifically requested and granted.




More information about the Lazarus mailing list