Antonio,
Yes, I'm using the same method as used by Jose with the printer and in your 'bluetoth' sample. I have a variant 'blueread' :
// BlueRead
include "FWCE.ch"
define GENERIC_READ 0x80000000
define GENERIC_WRITE 0x40000000
define OPEN_EXISTING 3
define FILE_ATTRIBUTE_NORMAL 0x00000080
function Main()
local oWnd
local hOut := CreateFile( "COM2:",GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL )
DEFINE WINDOW oWnd TITLE "BlueRead"
@ 2, 2 BUTTON "Read" ;
ACTION ReadText( hOut ) SIZE 80, 20
ACTIVATE WINDOW oWnd
CloseHandle( hOut )
return nil
function ReadText( hOut )
local nChr := 1
local cText := ""
local nLen := 0
msginfo(str(hOut))
do while nChr <> 0
nChr := bin2l( ReadByte( hOut ) )
cText := cText + Chr( nChr )
end do
msginfo( cText )
return nil
The port handle is displayed as -1 and then just blanks. I wondered if anyone has got this running in this mode. I will also need to write a response to the scanner, hence am using 'write' mode. Any help is gratefully received, thanks.