Forum > Other OS

WinCE compiler bug ?

(1/1)

swierzbicki:
Hello,

Can someone confirm this compiler bug ?

http://forum.lazarus.freepascal.org/index.php?topic=24406.msg146842#msg146842

Tomas Hajny:
Hi,

There is an issue indeed, but it is not a compiler bug but rather a problem with the RTL. I'll leave the resolution to people working with WinCE, but it should be rather easy.

swierzbicki:
That's neat ! I'm looking forward your solution.
Thank you.

alex208210:
I have a problem with bass.dll under wince 6. Lazarus 1.2.6 (fpc 2.6.4) + bass.pas (2.4.11) + bass.dll (2.4.11). Other versions bass.dll also have this problem. During playback of mp3 files, each time at a different time from 20 seconds to 5-10 minutes application crashes. Error text:
"Fatal error. The application has performed an illegal operation and will be closed. If the problem persists, contact the program manufacturer.
Exception 0xproject1.eхe "
X32 Windows does not have this problem

example: http://pbcdod.ru/basserror.zip

error - http://pbcdod.ru/scr1.jpg

the program code:


--- Code: ---unit Unit1;

{$mode delphi}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, bass;

type

  { TForm1 }

  TForm1 = class(TForm)

    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Timer1: TTimer;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;
  track:integer;
  Channel: DWORD;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
    BASS_Init(-1, 44100, 0, nil, nil);
    track:=1;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
TrackLen, TrackPos: Double;
ValPos: Double;
ValLen: Double;
begin
TrackPos:=BASS_ChannelBytes2Seconds(Channel, BASS_ChannelGetPosition(Channel,0));
TrackLen:=BASS_ChannelBytes2Seconds(Channel, BASS_ChannelGetLength(Channel,0));
ValPos:=TrackPos / (24 * 3600);
ValLen:=TrackLen / (24 * 3600);
Label1.Caption:=FormatDateTime('hh:mm:ss',ValPos);
Label2.Caption:=FormatDateTime('hh:mm:ss',ValLen);
if  BASS_ChannelIsActive(channel)=BASS_ACTIVE_STOPPED then begin  inc(track); if track>2 then track:=1; player; end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
BASS_ChannelStop(Channel);
BASS_StreamFree(Channel);
Channel := BASS_StreamCreateFile(false, PChar(ExtractFilePath(ParamStr(0))+inttostr(track)+'.mp3'), 0, 0, 0 );
BASS_ChannelPlay(Channel, False);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
 BASS_ChannelPause(Channel);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
 BASS_ChannelStop(Channel);
end;

procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  Bass_Stop();
  BASS_StreamFree(channel);
  Bass_Free;
end;

end.
--- End code ---


Help solve the problem. How can I keep track of exactly where to wince goes wrong? Was anyone has a similar problem and how to solve it?

Navigation

[0] Message Index

Go to full version