Userlib - byte parameters
BlitzPlus Forums/BlitzPlus Programming/Userlib - byte parameters
| ||
I want to use a Comm DLL that has the following functions that use byte size parameters. How do I translate the VB declares below into a Blitzplus Userlib.decls file. To I need to use a void (*) for the byte parameters and pass a bank to the dll? //Paste these declarations into your VB code... // //Declare Sub esInitUART Lib "EZSerial.dll" (ByVal iPort As Integer, ByVal iBaud As Integer, ByVal iParity As Byte, ByVal iBits As Byte, ByVal iStop As Byte) //Declare Function esTxByte Lib "EZSerial.dll" (ByVal iPort As Integer, ByVal iByte As Byte) As Byte //Declare Function esRxByte Lib "EZSerial.dll" (ByVal iPort As Integer, ByVal ParityChar As Byte) As Byte //Declare Function esWaitforTxReady Lib "EZSerial.dll" (ByVal iPort As Integer) As Boolean //Declare Function esRxReady Lib "EZSerial.dll" (ByVal iPort As Integer) As Boolean |
| ||
No, if you pass a bank you still pass a LONG (32 memory pointer). Unfortunately, since Blitz handles just LONG variables, there is no way to pass a BYTE. The only way is to write a wrapper DLL (in C or BlitzMAX), that receives LONGs from Blitz and then calls the COMM DLL. You can even try to pass LONGs and see what happens. :-) |
| ||
Thanks, I found found a workaround (use 9600,N,8,0 ipo 9600,N,*,1)for the bug with the api SetCommState function instead. |