Recent

Author Topic: Error converting hexadecimal lazarus win32  (Read 5075 times)

silviogs

  • New Member
  • *
  • Posts: 48
Error converting hexadecimal lazarus win32
« on: February 14, 2007, 12:59:16 pm »
Hi friends

I have this component installed in delphi7 and now I am trying to install it in lazarus, but it presents this error:


D:\lazarus\fpc\2.1.1\source\rtl\i386\math.inc(26,11) Error: Error converting hexadecimal 07FFFFFFF7FFFFFFF


procedure Set8087CW(cw:word);assembler;
      asm
{$ifndef REGCALL}
        movw cw,%ax
{$endif}
        movw %ax,default8087cw
        fnclex
        fldcw default8087cw
end;  


Somebody can help? :(

Thanks a lot

Silvio Guedes

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: Error converting hexadecimal lazarus win32
« Reply #1 on: February 14, 2007, 04:56:51 pm »
When exactly do you get this error?

silviogs

  • New Member
  • *
  • Posts: 48
Error converting hexadecimal lazarus win32
« Reply #2 on: February 15, 2007, 06:09:43 pm »
Hi vincent

   
I am trying to compile a component that prints bar code in the report. The component in Delphi 7 inherits of TQrStDBBarcode = class (TQRPrintable) happens that it presents the cited error above therefore I moved for TQrStDBBarcode = class (TfrReport). How he would be the correct one?

routine:

{$DEFINE USE_DATABASE} {Remove . to use database}

unit QrStDBBar;
{- Quick Report/SysTools barcode component}

interface

uses
  {$IFDEF Win32}
  Windows,
  {$ELSE}
  WinTypes, WinProcs,
  {$ENDIF}
  SysUtils, Messages, Classes, Graphics, Controls,
  QuickRpt, {Quick Report}
  {$IFDEF USE_DATABASE}
  DB,
  StDbBarC; {Systools Database Bar Code}
  {$ELSE}
  StBarC;   {Systools Bar Code}
  {$ENDIF}

type
  TStBarCodeClass = {$IFDEF USE_DATABASE}
                    TStDbBarCode;
                    {$ELSE}
                    TStBarCode;
                    {$ENDIF}

  TQrStDBBarcode = class(TQRPrintable)
   private
    FStBarCode : TStBarCodeClass;
   protected
    {$IFDEF USE_DATABASE}
    {Database methods}
    function  GetDataField : string;
    function  GetDataSource : TDataSource;
    procedure SetDataField(const Value : string);
    procedure SetDataSource(Value : TDataSource);
    {$ENDIF}

    {QR methods}
    procedure Paint; override;
    procedure Print(OfsX, OfsY : integer); override;
   public
    constructor Create(AOwner : TComponent); override;
    destructor  Destroy; override;

    property StBarCode : TStBarCodeClass
     read    FStBarCode
     write   FStBarCode;
   published
    {$IFDEF USE_DATABASE}
    property DataField : string
     read    GetDataField
     write   SetDataField;
    property DataSource : TDataSource
     read    GetDataSource
     write   SetDataSource;
    {$ENDIF}
  end;

procedure Register;

implementation

procedure Register;
begin
 RegisterComponents('BarCode', [TQrStDBBarcode]);
end;

constructor TQrStDBBarcode.Create(AOwner : TComponent);
begin
 inherited Create(AOwner);
 FStBarCode := TStBarCodeClass.Create(Self);
end;

destructor TQrStDBBarcode.Destroy;
begin
 FStBarCode.Free;
 inherited Destroy;
end;

{$IFDEF USE_DATABASE}
function TQrStDBBarcode.GetDataField : string;
begin
 result := FStBarCode.DataField;
end;

function TQrStDBBarcode.GetDataSource : TDataSource;
begin
 result := FStBarCode.DataSource;
end;

procedure TQrStDBBarcode.SetDataField(const Value : string);
begin
 FStBarCode.DataField := Value;
end;

procedure TQrStDBBarcode.SetDataSource(Value : TDataSource);
begin
 FStBarCode.DataSource := Value;
end;
{$ENDIF}

procedure TQrStDBBarcode.Paint;
begin
 FStBarCode.PaintToCanvas(Canvas, ClientRect);
end;

procedure TQrStDBBarcode.Print(OfsX, OfsY : integer);
var
 CodeLeft, CodeTop, CodeHeight : double;
 PixelsPerInchX : integer;
 PixelsPerInchY : integer;
begin
 PixelsPerInchX := GetDeviceCaps(ParentReport.QRPrinter.Canvas.Handle, LOGPIXELSX);
 PixelsPerInchY := GetDeviceCaps(ParentReport.QRPrinter.Canvas.Handle, LOGPIXELSY);
 CodeLeft   := ParentReport.QRPrinter.XPos(OfsX + Size.Left) * (1 / PixelsPerInchX);
 CodeTop    := ParentReport.QRPrinter.YPos(OfsY + Size.Top)  * (1 / PixelsPerInchY);
 CodeHeight := ParentReport.QRPrinter.YPos(OfsY + Size.Top + Size.Height) * (1 / PixelsPerInchY) - CodeTop;
 FStBarCode.PaintToCanvasSize(ParentReport.QRPrinter.Canvas, CodeLeft, CodeTop, CodeHeight);
end;

end.

Do you can help?

Thanks a lot

Silvio Guedes

 

TinyPortal © 2005-2018