Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-12

Raw print error

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Diwakoe

Dear all,

Today I try to create printing application using raw mode on win2003, sample printing program find at component folder compiled using 0.9.26 with fpc 2.2.2 svn rev:16885 and run well. All printers show including network share printer can print text.

I try to create new project using code take from examples only one event which is show list of printers on Form Create even, compiled with no error but error when run (attached).

Is this code is not suitable with 0.9.26? but why on example folde can compile and running well when compiled with this version?

Any help is appreciated.

Regards,
Diwa

Bellow is the code:
------------------------
unit Unit_prt_raw;

{$mode objfpc}{$H+}
interface

uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,

  StdCtrls, Printers;
type
  { TForm1 }
  TForm1 = class(TForm)
     ListBox1: TListBox;
     procedure FormCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;
var
  Form1: TForm1;
implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
   ListBox1.Items.Assign(Printer.Printers);
end;
initialization
  {$I unit_cetak.lrs}
end.
Semua rasa ada disini http://www.teoteblung.co.cc -------------- next part -------------- A non-text attachment was scrubbed... Name: raw_print_error.png Type: image/png Size: 5329 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20081201/19196496/attachment-0003.png>

Reply by email

Bogusław Brandys
to Diwakoe

"FAQ:
Q: If I use Printers unit, the call of printer object generate an exception "Access Violation".
A: Add in uses clause of your project, osPrinters."

Best regards
Boguslaw

Diwakoe pisze:

Show quoted text 73 lines
Dear all, Today I try to create printing application using raw mode on win2003, sample printing program find at component folder compiled using 0.9.26 with fpc 2.2.2 svn rev:16885 and run well. All printers show including network share printer can print text. I try to create new project using code take from examples only one event which is show list of printers on Form Create even, compiled with no error but error when run (attached). Is this code is not suitable with 0.9.26? but why on example folde can compile and running well when compiled with this version? Any help is appreciated. Regards, Diwa Bellow is the code: ------------------------ unit Unit_prt_raw; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, Printers; type { TForm1 } TForm1 = class(TForm) ListBox1: TListBox; procedure FormCreate(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin ListBox1.Items.Assign(Printer.Printers); end; initialization {$I unit_cetak.lrs} end. ------------------------------------------------------------------------ ------------------------------------------------------------------------ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bogusław Brandys
to Diwakoe: Today I try to create printing application using raw mode on win2003, sample printing…

OSPrinters in rawmodetest example is added to lpr file. Check your project lpr.

Boguslaw

Diwakoe pisze:

Show quoted text 73 lines
Dear all, Today I try to create printing application using raw mode on win2003, sample printing program find at component folder compiled using 0.9.26 with fpc 2.2.2 svn rev:16885 and run well. All printers show including network share printer can print text. I try to create new project using code take from examples only one event which is show list of printers on Form Create even, compiled with no error but error when run (attached). Is this code is not suitable with 0.9.26? but why on example folde can compile and running well when compiled with this version? Any help is appreciated. Regards, Diwa Bellow is the code: ------------------------ unit Unit_prt_raw; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, Printers; type { TForm1 } TForm1 = class(TForm) ListBox1: TListBox; procedure FormCreate(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin ListBox1.Items.Assign(Printer.Printers); end; initialization {$I unit_cetak.lrs} end. ------------------------------------------------------------------------ ------------------------------------------------------------------------ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email