by Richard Chidiak » Sat Feb 17, 2007 9:20 am
Antonio
No it is not good
This is the sample i am using (just to check the syntax)
I had to remove the INT RC (compile error)
#include "C:\FWPPC\INCLUDE\FWCE.ch"
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define GENERIC_REWRITE 0xC0000000
#define OPEN_EXISTING 3
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define FILE_FLAG_OVERLAPPED 0x40000000
#define WriteByte _WriteByte
function Main()
LOCAL I := 0, ;
CTEXTE := SPACE(30), ;
HOUT
hOut := CreateFile( "COM5:",GENERIC_REWRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL )
CTEXTE := "Désignation à suivre €"
SENDTEXT(hout,Ctexte)
CloseHandle( hOut )
RETURN Nil
function SendText( hOut, cText )
local n
for n = 1 to Len( cText )
WriteByte( hOut, Asc( SubStr( cText, n, 1 ) ) )
next
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
HB_FUNC( _WRITEBYTE ) // hComm, nChar --> lOk
{
DWORD cBytes;
unsigned char ch = 233;
// unsigned char ch = ( unsigned char ) hb_parnl( 2 );
hb_retl( ( BOOL ) WriteFile( ( void * ) hb_parnl( 1 ), &ch, 1, &cBytes, NULL ) );
}
#pragma ENDDUMP