Question

I have a label printer GoDex EZ2250i and i found some samples with delphi but none seems to works for me i try to compile with couple of dll's and the program doesnt even launch does anyone have experience on printing with this printer with delphi? thanks in advance, also the OS should be supported Windows7 and Windows 8.

the code that i tried:

unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const
 TestLib = 'Ezio64.dll'; // tried with Ezio32.dll same result

 procedure openport(port:PChar); stdcall; external TestLib ;
 procedure setup(a, b, c, d, e, f:Integer); stdcall; external TestLib;
 procedure sendcommand(command:PChar); stdcall; external TestLib;
 procedure intloadimage(filename, image_name, image_type:PChar); stdcall; external TestLib;
 procedure extloadimage(filename, image_name, image_type:PChar); stdcall; external TestLib;
 procedure ecTextOut(x:Integer; y:Integer; b:Integer; c:PChar; d:PChar); stdcall; external TestLib;
 procedure closeport; stdcall; external TestLib;



var
  Form2: TForm2;


implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin
  openport('0');    // 0-> LPT1; 1-> COM1; 2->COM2
  setup(30, 7, 2, 1, 0, 0);
  sendcommand('W70');
  sendcommand('^P1');
  sendcommand('^L');
  sendcommand('AC,20,60,1,1,1,0,TEST');
  ecTextOut(20, 10, 34, 'Ariel', 'Windows font - Ariel');
  sendcommand('E');
  closeport();
end;

end.
Was it helpful?

Solution

The program doesn't even launch.

This is symptomatic of a loader failure. For some reason, under the Delphi debugger, loader failures are not reported.

A loader failure typically occurs when:

  • A dependent DLL cannot be found, or,
  • A dependent DLL is found, but cannot be loaded, or,
  • A dependent DLL is loaded, but the imported functions cannot be found within.

To get more diagnostics run the executable outside of the debugger. Quite possibly you are trying to load 64 bit DLLs into your 32 bit process.

If diagnosis proves tricky, go back to the documentation for the library. Make sure you have installed all pre-requisites. Another common failure mode is a missing C++ runtime.

As a last resort, use Dependency Walker. Use the 32 bit version, and execute you program under Profile mode. This will pin-point the dependency failure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top