Code: Select all
#include "Windows.bi"
Dim As handle fh2, fh1
fh1=CreateFile("..\examples\unicode\hello_chinese.bas", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
Print "The handle #1: ", fh1
fh2=CreateFile("..\examples\unicode\hello_greek.bas", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
Print "The handle #2: ", fh2
if fh1=fh2 Then Print "The handles are equal, and that is NOT ok"
sleep
Code: Select all
The handle #1: 18446744073709551615
The handle #2: 18446744073709551615
The handles are equal, and that is NOT ok
P.S.: With Dim As longlong fh2, fh1, it works correctly. Maybe the type handle is not properly defined (it's type HANDLE as any ptr in WinNt.bi). There is also a not-so-well-known difference between HFILE and HANDLE, see this SOF thread.