Hello
I have purchased a bluetooth standalone printer Brother MW-140 BT
The communication is established between my pocket pc , hp ipaq 6515 and the printer and i can print any text documment or word document from the ppc.
The com ports are : Input 4, and Output 5
all params are ok
I can not print via fwppc (bluetooth program changing the correct ports), nothing happens. The handle is returned ok at opening com device but nothing prints... I can not figure out what an be wrong, any help will be welcome.
Tia
Richard
Sample of the code :
include "FWCE.ch"
define GENERIC_READ 0x80000000
define GENERIC_WRITE 0x40000000
define OPEN_EXISTING 3
define FILE_ATTRIBUTE_NORMAL 0x00000080
define FILE_FLAG_OVERLAPPED 0x40000000
function Main()
/
hCom = CreateFile( pcCommPort,
GENERIC_READ | GENERIC_WRITE,
0, // must be opened with exclusive-access
NULL, // no security attributes
OPEN_EXISTING, // must use OPEN_EXISTING
0, // not overlapped I/O
NULL // hTemplate must be NULL for comm devices
);
/
local oWnd
local hOut := CreateFile( "COM5:",GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL )
// local hIn := CreateFile( "COM4:", GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL )
DEFINE WINDOW oWnd TITLE "BlueTooth"
@ 2, 2 BUTTON "Send" ;
ACTION SendText( hOut, "Hello world!" ) SIZE 80, 20
ACTIVATE WINDOW oWnd
CloseHandle( hOut )
// CloseHandle( hIn )
return nil
function SendText( hOut, cText )
local n
for n = 1 to Len( cText )
WriteByte( hOut, Asc( SubStr( cText, n, 1 ) ) )
next
return nil