Recent

Author Topic: Report with wince (arm)  (Read 4670 times)

itcsis

  • Newbie
  • Posts: 3
Report with wince (arm)
« on: January 02, 2012, 10:33:53 am »
I’m development a program in delphi, and a module in lazarus for wince (arm) for a pda. All is fine, but I can’t print a report with the pda with a bluetooth printer. LazReport don’t works in wince.

I’ve tried with createfile to com port, but don’t work.

Somebody Have some idea or documentation.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Report with wince (arm)
« Reply #1 on: January 02, 2012, 10:49:22 am »
Does printing in general without LazReport work for you? (see http://wiki.lazarus.freepascal.org/Using_the_printer#The_Basic_Steps)

Which Lazarus version are you using?

Which exact code you tried with CreateFile?

itcsis

  • Newbie
  • Posts: 3
Re: Report with wince (arm)
« Reply #2 on: January 02, 2012, 11:26:32 am »
The Lazarus version is 0.9.28.2.beta (i tried with the 0.9.31 version but i uninstalled after)

Then code for createfile is (show CreateFile Error):

var
  hComm    : THandle;
  Cadena,
  CommPort : String;
  lrc      :LongWord;
  Seguridad : TSecurityAttributes;
  {$IFDEF Win32}
  SAnsi:AnsiString;
  Port:LPCSTR;
  {$ENDIF}
  {$IFDEF WinCE}
  SWide:WideString;
  Port:LPCWSTR;
  {$ENDIF}
begin
  CommPort := 'COM'+IntToStr(SpinEdit1.Value);
  {$IFDEF Win32}
  SAnsi:=CommPort;
  Port:=PChar(SAnsi);
  hComm := CreateFile( PChar(Port), GENERIC_WRITE, 0, nil{LPA}, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
  {$ENDIF}
  {$IFDEF WinCE}
  SWide:=CommPort;
  Port:=PWideChar(SWide);
  hComm := CreateFile( PWideChar(Port), GENERIC_WRITE, 0, nil{LPA}, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
  {$ENDIF}
  if (hComm = INVALID_HANDLE_VALUE) then begin
    ShowMessage('CreateFile Error!');
    exit;
  end;
  Cadena := 'Hola';
  WriteFile( hComm,Cadena,Length(Cadena), lrc, nil);
  CloseHandle(hComm);

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Report with wince (arm)
« Reply #3 on: January 03, 2012, 01:11:15 am »
The answer to my first question ("Does printing in general without LazReport work for you?") is quite important.

itcsis

  • Newbie
  • Posts: 3
Re: Report with wince (arm)
« Reply #4 on: January 03, 2012, 11:41:46 am »
I can't print anyway with wince. I don't mind the way for print.

if i use lazreport then not compile in wince. If i used createfile give me an error. I've got a bluetooh matrix printer.