WINCE slow redraw lazarus / 35-Windows CE ---------------------------------------------------------------------- NunoB · 2018-02-16 00:20 Hi guys, this is my first post in here, so go easy on me I've been developing a WinCE6 application in my free time. I bought one of those touchscreen chinese car head units with wince a couple of years ago for my 2015 BMW118d, and although it has all functionalities you could imagine, it has some quirks I'd like to solve, by implementing my own software. At least until I decide to move on to an Android unit. These are the device's specs, according to WR-Tools RESINFO: QuoteNOWADA NWD_308 multi-platform 6.0 Windows Embedded CE 6.0 156 MB RAM ARM11 -308- 800x480, 65536 colors This baby is capable of reproducing 1080p video content without hickups, but I believe that the original software uses some sort of acceleration. Anyway, I've been able to reproduce all original functionalities with Lazarus, including COM port habilities (Bluetooth, CANBUS and GPS), and now I'm trying to improve my GUI by adding scroll easing (like easeinoutquad for example) on the main menu. The problem is that, although easing works, redraw is very slow. It's slow in the emulator, and less slow on the device itself, but still slow, like 2fps. I've attached a simple example source code with emulator, if any of you is willing to advise, please download it. Extract it, execute Device_Emulator_Launcher.exe and click on 'Start Device'. Then, once the emulator starts, navigate to 'My Device'->'StorageCard'->'BMWConcept' and execute bmwconcept.exe. When the app starts, click on the highlighted button on the attached image. https://nofile.io/f/rF47wRUVsjc/MicrosoftDeviceEmulator_copy.zip So, what I'm trying to achieve, is it possible with Lazarus? Or am I trying to do too much with the hardware I've got? Thanks for your help and your precious time! ---------------------------------------------------------------------- donalejo · 2018-02-20 17:48 Hello the problem is use in the proyect this line :      Application.ApplicationType := atPDA; Example: program bmwconcept; {$mode objfpc}{$H+} uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Interfaces, // this includes the LCL widgetset   Forms, mainform   { you can add units after this }; {$R *.res} begin   RequireDerivedFormResource:=True;      Application.ApplicationType := atPDA;   Application.Initialize;   Application.CreateForm(TMain, Main);   Application.Run; end.                         Your indicate use the app a PDA, is longer documentation about this. Saludos desde Argentina ---------------------------------------------------------------------- NunoB · 2018-03-07 20:53 Hi, donalejo, thanks for trying to help. Unfortunately, as soon as I use the ApplicationType directive, the application refuses to run. This is the output on lcldebug.log: Quote[FORMS.PP] ExceptionOccurred   Sender=EListError   Exception=Cannot use find on unsorted list   Stack trace:   $0004FFB4   $0017DE94   $0010D038   $00103AAC   $F101FFFC TApplication.HandleException Cannot use find on unsorted list   Stack trace:   $0004FFB4   $0017DE94   $0010D038   $00103AAC   $F101FFFC [FORMS.PP] ExceptionOccurred This happens whether I use atPDA, atDefault or atDesktop. I tested your suggestion on the example code I posted, where I'm not even using lists, so could this be a bug? Thanks. ---------------------------------------------------------------------- avra · 2018-03-08 08:21 Quote from: NunoB on March 07, 2018, 09:53:45 pmI tested your suggestion on the example code I posted, where I'm not even using lists, so could this be a bug?Shouldn't this error text at least ring a bell to you: "Exception=Cannot use find on unsorted list"? ---------------------------------------------------------------------- Thaddy · 2018-03-08 08:39 Correct (unless trunk, where I believe it falls back to locate, at least I remember that was discussed on the bug tracker)). Use locate instead of find. Or sort the list if speed is important. ---------------------------------------------------------------------- NunoB · 2018-03-08 11:14 Quote from: avra on March 08, 2018, 09:21:51 amQuote from: NunoB on March 07, 2018, 09:53:45 pmI tested your suggestion on the example code I posted, where I'm not even using lists, so could this be a bug?Shouldn't this error text at least ring a bell to you: "Exception=Cannot use find on unsorted list"? Sure, that's the first thing I researched. But as I stated, in the simple example I posted, I'm not using TStringList anywhere, sorted or unsorted, much less doing a find. It's just a bunch of panels, a scrollbox and the easing class. Here's the code of the two files: mainform.pas: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit mainform; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,  StdCtrls, easing; type   { TMain }   TMain = class(TForm)    AudioPlayerPanel: TPanel;    BluetoothButtonPanel: TPanel;    ConfiguracaoButtonPanel: TPanel;    ContentPanel: TPanel;    FooterPanel: TPanel;    HomeButton: TImage;    ClockLabel: TLabel;    Image1: TImage;    Image10: TImage;    Image11: TImage;    Image12: TImage;    Image2: TImage;    Image3: TImage;    Image4: TImage;    Image5: TImage;    Image6: TImage;    Image7: TImage;    Image8: TImage;    Image9: TImage;    Label2: TLabel;    Label3: TLabel;    Label4: TLabel;    Label5: TLabel;    Label6: TLabel;    Label7: TLabel;    MenuContainerPanel: TScrollBox;    MenuMainPanel: TPanel;    MultimediaButtonPanel: TPanel;    NavegacaoButtonPanel: TPanel;    PaintBox1: TPaintBox;    ProgramasButtonPanel: TPanel;    RepeatPanel: TPanel;    PlayPanel: TPanel;    NextPanel: TPanel;    StopPanel: TPanel;    ShufflePanel: TPanel;    AudioPlayerTopPanel: TPanel;    PreviousPanel: TPanel;    TrackAlbum: TImage;    TrackAlbumLabel: TLabel;    TrackArtist: TImage;    TrackArtistLabel: TLabel;    TrackArtworkLarge: TImage;    TrackArtworkSmall: TImage;    Label1: TLabel;    ProgressHandlePanel: TPanel;    TrackArtistTitleLabel: TLabel;    MainPanel: TPanel;    HeaderPanel: TPanel;    AudioPlayerBottomPanel: TPanel;    HomeButtonPanel: TPanel;    ProgressBgPB: TPaintBox;    TrackBitrate: TLabel;    TrackGenre: TLabel;    TrackTitle: TImage;    TrackTitleLabel: TLabel;    ViaturaButtonPanel: TPanel;    procedure BluetoothButtonPanelMouseDown(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure BluetoothButtonPanelMouseUp(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure ConfiguracaoButtonPanelMouseDown(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure ConfiguracaoButtonPanelMouseUp(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure FormCreate(Sender: TObject);    procedure HomeButtonPanelMouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure HomeButtonPanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure MultimediaButtonPanelClick(Sender: TObject);    procedure MultimediaButtonPanelMouseDown(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure MultimediaButtonPanelMouseMove(Sender: TObject;      Shift: TShiftState; X, Y: Integer);    procedure MultimediaButtonPanelMouseUp(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure NavegacaoButtonPanelMouseDown(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure NavegacaoButtonPanelMouseUp(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure NextPanelMouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure NextPanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure PlayPanelMouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure PlayPanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure PreviousPanelMouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure PreviousPanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure ProgramasButtonPanelMouseDown(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure ProgramasButtonPanelMouseUp(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure RepeatPanelMouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure RepeatPanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure ShufflePanelMouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure ShufflePanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure StopPanelMouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure StopPanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure ViaturaButtonPanelMouseDown(Sender: TObject;      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);    procedure ViaturaButtonPanelMouseUp(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure TweenScrollBy(Sender: TObject; startPoint, endPoint: integer;      Duration: integer; Direction: string; easeType: TChromeTabsEaseType);  private    { private declarations }  public    { public declarations }  end; var  Main: TMain;  CurrentVisibleMenu: TPanel;  MouseDownOnMenu: Boolean; implementation {$R *.lfm} { TMain } procedure TMain.HomeButtonPanelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  HomeButtonPanel.Color := $000D70FF;  Application.Terminate;end; procedure TMain.HomeButtonPanelMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  HomeButtonPanel.Color := $007F7F7F;end; procedure TMain.BluetoothButtonPanelMouseDown(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  BluetoothButtonPanel.Color := $000D70FF;  MouseDownOnMenu := True;end; procedure TMain.BluetoothButtonPanelMouseUp(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  BluetoothButtonPanel.Color := $00666666;  MouseDownOnMenu := False;end; procedure TMain.ConfiguracaoButtonPanelMouseDown(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  ConfiguracaoButtonPanel.Color := $000D70FF;  MouseDownOnMenu := True;end; procedure TMain.ConfiguracaoButtonPanelMouseUp(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  ConfiguracaoButtonPanel.Color := $004C4C4C;  MouseDownOnMenu := False;end; procedure TMain.FormCreate(Sender: TObject);begin  CurrentVisibleMenu := MenuMainPanel;  MenuContainerPanel.DoubleBuffered := True;  MultimediaButtonPanel.DoubleBuffered := True;  NavegacaoButtonPanel.DoubleBuffered := True;  BluetoothButtonPanel.DoubleBuffered := True;  ProgramasButtonPanel.DoubleBuffered := True;  ViaturaButtonPanel.DoubleBuffered := True;  ConfiguracaoButtonPanel.DoubleBuffered := True;end; procedure TMain.MultimediaButtonPanelMouseDown(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  MultimediaButtonPanel.Color := $000D70FF;  MouseDownOnMenu := True;end; procedure TMain.MultimediaButtonPanelMouseMove(Sender: TObject;  Shift: TShiftState; X, Y: Integer);begin  //TPanel(CurrentVisibleMenu).Left := Mouse.CursorPos.X;end; procedure TMain.MultimediaButtonPanelMouseUp(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  MultimediaButtonPanel.Color := $00666666;  MouseDownOnMenu := False;end; procedure TMain.MultimediaButtonPanelClick(Sender: TObject);begin  ShowMessage('teste');end; procedure TMain.NavegacaoButtonPanelMouseDown(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  NavegacaoButtonPanel.Color := $000D70FF;  MouseDownOnMenu := True;end; procedure TMain.NavegacaoButtonPanelMouseUp(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  NavegacaoButtonPanel.Color := $004C4C4C;  MouseDownOnMenu := False;end; procedure TMain.NextPanelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  NextPanel.Color := $000D70FF;  TweenScrollBy(CurrentVisibleMenu, -760, 0, 100, 'horizontal', tteaseInOutQuad);end; procedure TMain.NextPanelMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  NextPanel.Color := $00999999;end; procedure TMain.PlayPanelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  PlayPanel.Color := $000D70FF;end; procedure TMain.PlayPanelMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  PlayPanel.Color := $00B2B2B2;end; procedure TMain.PreviousPanelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  PreviousPanel.Color := $000D70FF;  TweenScrollBy(CurrentVisibleMenu, 0, -760, 100, 'horizontal', tteaseInOutQuad);end; procedure TMain.PreviousPanelMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  PreviousPanel.Color := $00B2B2B2;end; procedure TMain.ProgramasButtonPanelMouseDown(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  ProgramasButtonPanel.Color := $000D70FF;  MouseDownOnMenu := True;end; procedure TMain.ProgramasButtonPanelMouseUp(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  ProgramasButtonPanel.Color := $004C4C4C;  MouseDownOnMenu := False;end; procedure TMain.RepeatPanelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  RepeatPanel.Color := $000D70FF;end; procedure TMain.RepeatPanelMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  RepeatPanel.Color := $007F7F7F;end; procedure TMain.ShufflePanelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  ShufflePanel.Color := $000D70FF;end; procedure TMain.ShufflePanelMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  ShufflePanel.Color := $00999999;end; procedure TMain.StopPanelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  StopPanel.Color := $000D70FF;end; procedure TMain.StopPanelMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  StopPanel.Color := $00CCCCCC;end; procedure TMain.ViaturaButtonPanelMouseDown(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  ViaturaButtonPanel.Color := $000D70FF;  MouseDownOnMenu := True;end; procedure TMain.ViaturaButtonPanelMouseUp(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  ViaturaButtonPanel.Color := $00666666;  MouseDownOnMenu := False;end; procedure TMain.TweenScrollBy(Sender: TObject; startPoint, endPoint: integer;  Duration: integer; Direction: string; easeType: TChromeTabsEaseType);var  i, j: integer;begin  for i := 1 to Duration do  begin    j := Trunc(CalculateEase(startPoint, endPoint, i, Duration, easeType));    if ((startPoint > endPoint) and (j < endPoint)) or      ((startPoint < endPoint) and (j > endPoint)) then    j := endPoint;     case Direction of      'vertical': TPanel(CurrentVisibleMenu).Top := j;      'horizontal': TPanel(CurrentVisibleMenu).Left := j;    end;     TPanel(CurrentVisibleMenu).Update;  end;end; end. easing.pas: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit easing; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Math; type  TChromeTabsEaseType = (    ttlinearTween,    tteaseInQuad,    tteaseOutQuad,    tteaseInOutQuad,    tteaseInCubic,    tteaseOutCubic,    tteaseInOutCubic,    tteaseInQuart,    tteaseOutQuart,    tteaseInOutQuart,    tteaseInQuint,    tteaseOutQuint,    tteaseInOutQuint,    tteaseInSine,    tteaseOutSine,    tteaseInOutSine,    tteaseInExpo,    tteaseOutExpo,    tteaseInOutExpo,    tteaseInCirc,    tteaseOutCirc,    tteaseInOutCirc    ); function CalculateEase(CurrentTime, StartValue, ChangeInValue, Duration: real;  EaseType: TChromeTabsEaseType): real; overload;function CalculateEase(StartPos, EndPos, PositionPct: real;  Duration: integer; EaseType: TChromeTabsEaseType): real; overload; implementation function CalculateEase(CurrentTime, StartValue, ChangeInValue, Duration: real;  EaseType: TChromeTabsEaseType): real;begin  case EaseType of    ttLinearTween:  begin      Result := ChangeInValue * CurrentTime / Duration + StartValue;    end;     ttEaseInQuad:    begin      CurrentTime := CurrentTime / Duration;       Result := ChangeInValue * CurrentTime * CurrentTime + StartValue;    end;     ttEaseOutQuad:    begin      CurrentTime := CurrentTime / Duration;       Result := -ChangeInValue * CurrentTime * (CurrentTime - 2) + StartValue;    end;     ttEaseInOutQuad:    begin      CurrentTime := CurrentTime / (Duration / 2);       if CurrentTime < 1 then        Result := ChangeInValue / 2 * CurrentTime * CurrentTime + StartValue      else      begin        CurrentTime := CurrentTime - 1;        Result := -ChangeInValue / 2 * (CurrentTime * (CurrentTime - 2) - 1) +          StartValue;      end;    end;     ttEaseInCubic:    begin      CurrentTime := CurrentTime / Duration;       Result := ChangeInValue * CurrentTime * CurrentTime * CurrentTime + StartValue;    end;     ttEaseOutCubic:  begin      CurrentTime := (CurrentTime / Duration) - 1;       Result := ChangeInValue * (CurrentTime * CurrentTime * CurrentTime + 1) +      StartValue;    end;     ttEaseInOutCubic:    begin      CurrentTime := CurrentTime / (Duration / 2);       if CurrentTime < 1 then        Result := ChangeInValue / 2 * CurrentTime * CurrentTime *          CurrentTime + StartValue      else      begin        CurrentTime := CurrentTime - 2;         Result := ChangeInValue / 2 * (CurrentTime * CurrentTime *          CurrentTime + 2) + StartValue;      end;    end;     ttEaseInQuart:    begin      CurrentTime := CurrentTime / Duration;       Result := ChangeInValue * CurrentTime * CurrentTime * CurrentTime *        CurrentTime + StartValue;    end;     ttEaseOutQuart:    begin      CurrentTime := (CurrentTime / Duration) - 1;       Result := -ChangeInValue * (CurrentTime * CurrentTime *      CurrentTime * CurrentTime - 1) + StartValue;    end;     ttEaseInOutQuart:    begin      CurrentTime := CurrentTime / (Duration / 2);       if CurrentTime < 1 then        Result := ChangeInValue / 2 * CurrentTime * CurrentTime *          CurrentTime * CurrentTime + StartValue      else      begin        CurrentTime := CurrentTime - 2;         Result := -ChangeInValue / 2 * (CurrentTime * CurrentTime *          CurrentTime * CurrentTime - 2) + StartValue;      end;    end;     ttEaseInQuint:    begin      CurrentTime := CurrentTime / Duration;       Result := ChangeInValue * CurrentTime * CurrentTime * CurrentTime *        CurrentTime * CurrentTime + StartValue;    end;     ttEaseOutQuint:    begin      CurrentTime := (CurrentTime / Duration) - 1;       Result := ChangeInValue * (CurrentTime * CurrentTime *        CurrentTime * CurrentTime * CurrentTime + 1) + StartValue;    end;     ttEaseInOutQuint:    begin      CurrentTime := CurrentTime / (Duration / 2);      if CurrentTime < 1 then        Result := ChangeInValue / 2 * CurrentTime * CurrentTime *          CurrentTime * CurrentTime * CurrentTime + StartValue      else      begin        CurrentTime := CurrentTime - 2;         Result := ChangeInValue / 2 * (CurrentTime * CurrentTime *          CurrentTime * CurrentTime * CurrentTime + 2) + StartValue;      end;    end;     ttEaseInSine:    begin      Result := -ChangeInValue * Cos(CurrentTime / Duration * (PI / 2)) +        ChangeInValue + StartValue;    end;   ttEaseOutSine:    begin      Result := ChangeInValue * Sin(CurrentTime / Duration * (PI / 2)) + StartValue;    end;     ttEaseInOutSine:    begin      Result := -ChangeInValue / 2 * (Cos(PI * CurrentTime / Duration) - 1) +        StartValue;    end;     ttEaseInExpo:    begin      Result := ChangeInValue * Power(2, 10 * (CurrentTime / Duration - 1)) +        StartValue;    end;     ttEaseOutExpo:    begin      Result := ChangeInValue * (-Power(2, -10 * CurrentTime / Duration) + 1) +        StartValue;    end;     ttEaseInOutExpo:    begin      CurrentTime := CurrentTime / (Duration / 2);       if CurrentTime < 1 then        Result := ChangeInValue / 2 * Power(2, 10 * (CurrentTime - 1)) + StartValue      else      begin      CurrentTime := CurrentTime - 1;         Result := ChangeInValue / 2 * (-Power(2, -10 * CurrentTime) + 2) +          StartValue;      end;    end;     ttEaseInCirc:    begin      CurrentTime := CurrentTime / Duration;       Result := -ChangeInValue * (Sqrt(1 - CurrentTime * CurrentTime) - 1) +        StartValue;    end;     ttEaseOutCirc:    begin      CurrentTime := (CurrentTime / Duration) - 1;       Result := ChangeInValue * Sqrt(1 - CurrentTime * CurrentTime) + StartValue;    end;     ttEaseInOutCirc:    begin      CurrentTime := CurrentTime / (Duration / 2);       if CurrentTime < 1 then        Result := -ChangeInValue / 2 * (Sqrt(1 - CurrentTime * CurrentTime) - 1) +          StartValue      else      begin        CurrentTime := CurrentTime - 2;         Result := ChangeInValue / 2 * (Sqrt(1 - CurrentTime * CurrentTime) + 1) +          StartValue;      end;    end;  end;end; function CalculateEase(StartPos, EndPos, PositionPct: real;  Duration: integer; EaseType: TChromeTabsEaseType): real;var  t, b, c, d: real;begin  c := EndPos - StartPos;  d := Duration;  t := PositionPct;  b := StartPos;   Result := CalculateEase(t, b, c, d, EaseType);end; end. Besides, if I compile for win32 and include the ApplicationType directive, the app runs perfectly. When I compile and run for wince and include the ApplicationType directive, the problem arises. So, if it runs perfectly in wince if I omit the ApplicationType directive, the problem must reside somewhere upstream in one of the includes and is specific for wince? I'm using Lazarus v1.6.4 with FPC 3.0.2. Excuse my ignorance, it's been 15 years since I last programmed in Pascal. ---------------------------------------------------------------------- avra · 2018-03-08 19:41 That error string is SErrFindNeedsSortedList in rtlconst.inc and can be tracked to a single usage in stringl.inc: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function TStringList.Find(const S: string; out Index: Integer): Boolean;...  if Not Sorted then    Raise EListError.Create(SErrFindNeedsSortedList);  Quote from: NunoB on March 08, 2018, 12:14:51 pmI'm not using TStringList anywhere, sorted or unsorted, much less doing a find.It exists somewhere, and is not behaving properly on WinCE. If you are lucky then some of the components you have on the screen has it (memo or something else). Delete one by one to find out in runtime. Even make an empty project to see if it shows. If you are not lucky then problematic string list is not visual and you will have to examine any ancestor of anything you use if it has string list. Backup your project, then rip it off more and more to find what creates the problem. You can also use logging to find what line was last executed before that exception. QuoteI'm using Lazarus v1.6.4 with FPC 3.0.2.You can try some older Lazarus (even with FPC 2.6.4), and you can try latest trunks. Maybe something changes in your favor. Quoteit's been 15 years since I last programmed in Pascal.Welcome back ---------------------------------------------------------------------- NunoB · 2018-03-11 23:41 Cheers avra and thanks for your experienced and precious help. Unfortunately, even an empty project (just a form, no objects) results in the same error, which means this is in fact a bug. I'll try an earlier Lazarus/FPC, maybe I'll be able to pinpoint the revision where this bug was introduced. Thanks also to Thaddy who actually realized this is a bug. It must be hard to keep Lazarus compatible with such an outdated OS such as WinCE and it's actually amazing how you guys managed to do this for so long. I would have used VS and C++, but it's actually hard (if not impossible) to get a VS2005 with WinCE SDK working on a 64bit Win10 system, which is my development machine. It's also as hard to debug, since the emulator is a 32bit application and I wasn't able to get debug to work due to this fact. That's why I opted for Lazarus, and I must say I'm very impressed with this IDE. Thanks again for all the help, this is an awesome community All the best, Nuno ---------------------------------------------------------------------- avra · 2018-03-12 07:39 Quote from: NunoB on March 12, 2018, 12:41:44 amUnfortunately, even an empty project (just a form, no objects) results in the same error, which means this is in fact a bug.Then you can try to patch TStringList.Find not to raise that exception (maybe just try to return not found result instead), rebuild IDE, and see what happens with newly build empty project. If you play with it a little I think you can achieve enough for your purpose. You have a full source of everything, so you can be as much of a master as you need to. Quote from: NunoB on March 12, 2018, 12:41:44 amI'll try an earlier Lazarus/FPC, maybe I'll be able to pinpoint the revision where this bug was introduced.I would test Laz 1.2 + FPC 2.6.4 (if I remember well it was good on WinCE), but I would also test latest trunk versions of Laz and FPC. You can use fpcupdeluxe (google if you don't know what that is) to download those versions without affecting your current installation at all.