[Gambas-user] Migrate VB6 project to Gambas 2.0 ?

2020 sylvain.marleau at ...647...
Thu Feb 21 00:28:37 CET 2008


Hi Ron,  after your recommendations, same problem ... return code 1 (invalid
handle) with identical handles. 

Thanks in advance,
Sylvain. 

Test #2;

' Gambas class file
PRIVATE EXTERN FT_Open(intDeviceNumber AS Integer, plngHandle AS Pointer) AS
Integer IN "libftd2xx"
PRIVATE EXTERN FT_Close(plngHandle AS Pointer) AS Integer IN "libftd2xx"
PRIVATE plngHandle AS Pointer = Alloc(4)
PRIVATE intDeviceNumber AS Integer
' Return codes 
PRIVATE CONST FT_OK AS Integer = 0 
PRIVATE CONST FT_INVALID_HANDLE AS Integer = 1 
PRIVATE CONST FT_DEVICE_NOT_FOUND AS Integer = 2 
PRIVATE CONST FT_DEVICE_NOT_OPENED AS Integer = 3 

PUBLIC SUB Form_Open()
  DIM returnCodes1 AS Integer
  DIM returnCodes2 AS Integer  
' open the device
  returnCodes1 = FT_Open(0, plngHandle)
  PRINT returnCodes1, plngHandle
' close the device  
  returnCodes2 = FT_Close(plngHandle)
  PRINT returnCodes2, plngHandle
END

Console output;
0       136297432
1       136297432
-- 
View this message in context: http://www.nabble.com/Migrate-VB6-project-to-Gambas--2.0---tp15372045p15601452.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list