Recent

Author Topic: makeing interfaces for wince?  (Read 32347 times)

roozbeh

  • New Member
  • *
  • Posts: 18
    • http://www.spv3d.com
makeing interfaces for wince?
« on: March 31, 2006, 10:11:04 am »
Hi...
i am trying to build interfaces and other things for wince but i cand fine any instructions!

i made this fpc.cfg file in interfaces dir

Code: [Select]
-Twince
-Fue:\fpc\fpc\units\arm-wince
-Fie:\fpc\lazarus\lcl
-Fue:\fpc\source\fcl\inc
-Fue:\fpc\lazarus\lcl\widgetset
-Fie:\fpc\lazarus\lcl\widgetset
-Fue:\fpc\source\fcl\image
-Fie:\fpc\lazarus\lcl\include
-Fue:\fpc\lazarus\lcl
-XParm-wince-
-FDe:\fpc\arm


but it ends in interfaces.ppu with error "Can't find unit Unix"
and when i add -dWin32 then it builds everything but give error about override problem!

besides is there anyway to do this in lazarus?instead of creating a .bat file and running that?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: makeing interfaces for wince?
« Reply #1 on: March 31, 2006, 01:52:22 pm »
Take a look at the wiki: http://wiki.lazarus.freepascal.org/index.php/Windows_CE_Interface

Step 2 will compile LCL

If you want to compile FCL and other things, there are instructions here:

http://www.freepascal.org/wiki/index.php/WinCE_port#Building_FPC_libraries

roozbeh

  • New Member
  • *
  • Posts: 18
    • http://www.spv3d.com
RE: makeing interfaces for wince?
« Reply #2 on: March 31, 2006, 03:17:43 pm »
well thanks i managed to compile everything and it also compiled my one form application
but the problem is it doesnt run.
error message is file not found or one of its componenets.
seems like a missing dll file is linked or i dont know.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: makeing interfaces for wince?
« Reply #3 on: April 01, 2006, 04:27:33 am »
What components did you drop on the Form? Currently only TForm itself, TButton and TEdit work.

It's really easy to add new components and new properties, just look at the current wince code, at the win32 code and try to follow the same guidelines. I can guide you if you need help doing this.

The code is located at: /lcl/interfaces/wince

There is information about it here: http://wiki.lazarus.freepascal.org/index.php/LCL_Internals

and here: http://wiki.lazarus.freepascal.org/index.php/Windows_CE_Interface#How_to_add_a_new_control

roozbeh

  • New Member
  • *
  • Posts: 18
    • http://www.spv3d.com
makeing interfaces for wince?
« Reply #4 on: April 01, 2006, 08:48:14 am »
well just a simple form...but i tried a lot and couldnt make it run.
can you see if your simple form exe also have these dependencies?
dependency walker report me these dependencies:
coredll.dll
coredll.dll
commdlg.dll
commctrl.dll
ceshell.dll
aygshell.dll

also with simply those instruction given in wiki i couldnt compile lcl.
in gtk directory it exit with error code of glib unit not found.
well anyway i dont think gtk is neccessary.

my project1.lpr
Code: [Select]
program project1;

{$mode objfpc}{$H+}

uses
  Interfaces, // this includes the LCL widgetset
  Forms
  { add your units here }, Unit1;

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

my unit1.pas
Code: [Select]
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons;
type
  { TForm1 }
  TForm1 = class(TForm)
    Button1: TButton;
  private
    { private declarations }
  public
    { public declarations }
  end;
var
  Form1: TForm1;
implementation
initialization
  {$I unit1.lrs}
end.

my unit1.lfm
Code: [Select]
object Form1: TForm1
  Caption = 'Form1'
  ClientHeight = 300
  ClientWidth = 400
  PixelsPerInch = 96
  HorzScrollBar.Page = 399
  VertScrollBar.Page = 299
  Left = 290
  Height = 300
  Top = 149
  Width = 400
  object Button1: TButton
    BorderSpacing.InnerBorder = 2
    Caption = 'Button1'
    TabOrder = 0
    Left = 101
    Height = 25
    Top = 41
    Width = 75
  end
end


well i can only think of wrong ppcrossarm.exe being built to produce this errors?
maybe if you send me yours i can figure that too.

Anonymous

  • Guest
makeing interfaces for wince?
« Reply #5 on: April 01, 2006, 10:42:46 am »
well i once again updated from reposity and now when building compiler i came to this

e:/fpc/fpc/bin/i386-win32/rm.exe -f *.s *_ppas.bat
make[3]: Leaving directory `E:/fpc/source2/rtl/wince'
make[2]: Leaving directory `E:/fpc/source2/rtl'
make -C ../rtl 'OPT=' all
make[2]: Entering directory `E:/fpc/source2/rtl'
make -C wince all
make[3]: Entering directory `E:/fpc/source2/rtl/wince'
e:/fpc/fpc/bin/i386-win32/gmkdir.exe -p ../../rtl/units/arm-wince
arm-wince-as  -o ../../rtl/units/arm-wince/wprt0.o arm/wprt0.as
process_begin: CreateProcess((null), arm-wince-as -o ../../rtl/units/arm-wince/w
prt0.o arm/wprt0.as, ...) failed.
make (e=2): The system cannot find the file specified.
make[3]: *** [wprt0.o] Error 2
make[3]: Leaving directory `E:/fpc/source2/rtl/wince'
make[2]: *** [wince_all] Error 2
make[2]: Leaving directory `E:/fpc/source2/rtl'
make[1]: ***
Error 2
make[1]: Leaving directory `E:/fpc/source2/compiler'
make: *** [cycle] Error 2

roozbeh

  • New Member
  • *
  • Posts: 18
    • http://www.spv3d.com
makeing interfaces for wince?
« Reply #6 on: April 01, 2006, 01:40:12 pm »
well finally i managed to make it run.
seems that -dwin32 caouse problems in previous builds which wasnt required.

but now as soon as i run the program..a form appears with minimize,maximimze,close icons and then quits.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
makeing interfaces for wince?
« Reply #7 on: April 01, 2006, 03:27:30 pm »
Ok, you are running the software on a emulator or on your pocketpc?

Also, try to run it from the command line so you can see any error messages and post them here.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
makeing interfaces for wince?
« Reply #8 on: April 01, 2006, 03:38:41 pm »
Quote from: "roozbeh"
well finally i managed to make it run.
seems that -dwin32 caouse problems in previous builds which wasnt required.


You were passing -dwin32 when building your software or lcl?

Be careful that the instructions work, but they must be followed strictly.

roozbeh

  • New Member
  • *
  • Posts: 18
    • http://www.spv3d.com
makeing interfaces for wince?
« Reply #9 on: April 01, 2006, 04:12:45 pm »
i am running it on pocketpc preview arm emulator
i traced it in gdb and it generates two exceptions

0x00152058 in TLRSOBJECTREADER__BEGINROOTCOMPONENT (this=0x698d38)
    at LResources.pp:2979
which seems not important becouse after that form is being drawned and after this

Program received signal ?, Unknown signal.
0x0001a858 in fpc_ansistr_decr_ref ()

program closes itself.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
makeing interfaces for wince?
« Reply #10 on: April 01, 2006, 06:45:59 pm »
I think we are experiencing some instability because of changes on the compiler code.

Using 2.1.x is an adventure =)

I just did a clean checkout of Free Pascal 2.1 source and I will go thought the whole build process to ensure that the steps on the Wiki work. And also to detect what is missing so we can compile LCL and software from the IDE

As sson as I succeed, I will let you know which FPC revision I used and if anything had to be changed on the Wiki instructions.

roozbeh

  • New Member
  • *
  • Posts: 18
    • http://www.spv3d.com
makeing interfaces for wince?
« Reply #11 on: April 01, 2006, 11:05:19 pm »
hmmm....
thanks for your responses so far...i am really waiting for your results ;)
hope sooner you can achive those as i am now on holidays and have free times

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
makeing interfaces for wince?
« Reply #12 on: April 02, 2006, 12:24:29 am »
Some partial results.

There is clearly something wrong with the compiler code. Before my WinCE Executables with debug info were 2MB in size, now they are almost 10MB. Also, now they crash with a misaligned data access. Before they worked very well.

This using revision 3100. Revision after this one won´t compile.

The solution is to find an older revision that works, until the Free Pascal developers can fix those issues.

I think the last compiler I used was from 1 month ago. Some revisions that seam good to test are 2900 (2 weeks ago) and 2700 (1 month ago).

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
makeing interfaces for wince?
« Reply #13 on: April 02, 2006, 12:56:46 am »
Solution found. Use revision 3000 of the compiler =)

Revisions before that cannot be used because Lazarus code now uses some features introduced at 2996 I think.

On one of the revisions after 3000 and before 3100 some bugs were introduced. Probably some new features are being added and they caused this instability.

roozbeh

  • New Member
  • *
  • Posts: 18
    • http://www.spv3d.com
makeing interfaces for wince?
« Reply #14 on: April 02, 2006, 11:17:15 pm »
well thanks.
although with this compiler also file size is around 9mg and after wince-arm-strip utility it gets down to 2.

about lcl interfaces,is there any reason why they are not so alike win32 interfaces?
as they do almost very same tasks?
for example there is no preparewindow function created or....although i dont know why they choose this method.but i think if that method worked so far with win32 it might also work with wince too.

i have implemented lots of other controls,just wondering how coding styles should be...should i write as i wish or any rules or...
for example i dont like calling and seeing MultiByteToWideChar whenever i want something to be trasfered to unicode and backward..so i've implemented strtounicode as a simple function.
for example is there a problem with doing so or not?

anyway where to send modified sources?

 

TinyPortal © 2005-2018