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

2020 sylvain.marleau at ...647...
Tue Feb 19 03:55:20 CET 2008



Benoit Minisini wrote:
> 
> On samedi 9 février 2008, 2020 wrote:
>> Hello folk,
>>
>> I am trying to migrate a VB6 project to Gambas 2.0.
>>
>> My VB6 project require ftd2xx.dll, but in xubuntu 7.10 I will used
>> ftdi_sio
>> driver (FTDI USB Serial Device converter).
>>
>> All I want to do is to call FTDI functions from Gambas 2.0 project.
>>
>> Snippet code from my VB6 project;
>> Private Declare Function FT_Open Lib "FTD2XX.DLL" (ByVal intDeviceNumber
>> As
>  Integer, ByRef lngHandle As Long) As Long
>>
>> Any ideas, thanks in advance.
>>
>> Sylvain.
> 
> You must tell me the prototype of the function in C to be sure. So the 
> following *may* work:
> 
> It is a bit complicated in Gambas 2, because VarPtr() exists only in
> Gambas 3.
> 
> --8<---------------------------
> 
> PRIVATE EXTERN FT_Open(intDeviceNumber AS Integer, plngHandle AS Pointer)
> AS 
> Integer
> 
> ...
> 
> DIM plngHandle AS Pointer = Alloc(8)
> DIM lngHandle AS Integer
> DIM iRet AS Integer
> 
> iRet = FT_Open(..., plngHandle)
> READ #plngHandle, lngHandle
> 
> --8<---------------------------
> 
> Tell me if it works.
> 
> Regards,
> 
> -- 
> Benoit Minisini
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 

Bonjour Benoit, 

Q1: What do you mean by "prototype of the function in C" in your first
statement.

Test1; 

The open device function works fine, but the close device function failed
... return code 1 (invalid handle).

For more details ---> 
http://www.nabble.com/file/p15550851/test1%2Bopen%2Bdmx%2Busb.png  
http://www.nabble.com/file/p15550851/test1%2Bopen%2Bdmx%2Busb.txt
test1+open+dmx+usb.txt 

Thanks in advance,
Sylvain.


-- 
View this message in context: http://www.nabble.com/Migrate-VB6-project-to-Gambas--2.0---tp15372045p15550851.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list