Recent

Author Topic: Lazarus and PocketPC 2002  (Read 18881 times)

FPascal

  • Newbie
  • Posts: 5
Lazarus and PocketPC 2002
« on: July 26, 2008, 01:04:44 am »
Hello,
I see that Lazarus applications do not work under PocketPC 2002 (both using LCL or KOL) under my IPAQ 3760. They instead work well under WM5.

Is PPC 2002 unsupported?
And 2003? Does it work?

P.S. under PPC 2002 I was able to make a full program using Windows API (CreateWindow, etc...) but I was not able to remove the Forms unit and the app size is 1.3 Mb.

Is it possible to define a standard WinMain function and strip all the LCL code away? Maybe using fpc without Lazarus?
Thanks!

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Lazarus and PocketPC 2002
« Reply #1 on: July 28, 2008, 04:58:09 am »
PPC 2002 should be supported. What error message do you receive?

Make sure that you have the aygshell.dll in your windows directory in the PPC.

> and the app size is 1.3 Mb.

Use the strip command line utility to remove debug information which diminishes the executable size. Read in the wiki about how to use it:

http://wiki.lazarus.freepascal.org/Lazarus_Faq#Why_are_the_generated_binaries_so_big.3F

> Is it possible to define a standard WinMain function and strip all the LCL code away? Maybe using fpc without Lazarus?

You can use Lazarus to create FPC software which don't use the LCL. Just don't use the LCL and don't add LCL units to your uses clause.

FPascal

  • Newbie
  • Posts: 5
Lazarus and PocketPC 2002
« Reply #2 on: July 28, 2008, 09:42:24 am »
Yes, I have aygshell.dll (and I call its functions from my SDK-based program).

On my IPaq 3760 PPC 2002 (very common device!):
LCL programs start and exit immeditately.
KOL programs shows "Access violation" at startup, then exits.

If I remove the Application.CreateForm command they "work" and I can execute some commands like MessageBox, etc.

By the way I'm very satisfied with Lazarus/fpc, I'm making a complex application just creating all the child controls runtime via CreateWindow(), and getting the events via the message queue, just like C programming in Windows 15 years ago (menus, bitmaps and icons via Resources).

I removed all the references to Forms and Classes, the program size is 30k.
[/quote]

arnoldb

  • Jr. Member
  • **
  • Posts: 97
Lazarus and PocketPC 2002
« Reply #3 on: July 28, 2008, 10:46:48 am »
For the record, Lazarus applications definitely work on PPC2003 on my iPAQ h5550, including Wireless networking with LNet 0.6.2.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Lazarus and PocketPC 2002
« Reply #4 on: July 30, 2008, 04:43:58 am »
You can try the following:

1 - Debug and get a backtrace of the crash. Instructions in the wiki:

http://wiki.lazarus.freepascal.org/Windows_CE_Interface#Debugging_Windows_CE_software_on_the_Lazarus_IDE

or

2 - Comment the internal LCL code for CreateForm, rebuild the LCL and test the program again. Repeat until you isolate the cause. The CreateForm code is in lazarus/lcl/interfaces/wince/wincewsforms.pp

Search for TWinceWSCustomForm.CreateHandle

FPascal

  • Newbie
  • Posts: 5
Lazarus and PocketPC 2002
« Reply #5 on: August 09, 2008, 12:51:19 am »
That proved too complicated for me, and also KOL-CE doesn't work on PPC 2002.
By the way, I had the crash also on the final version of my "pure" Windows CE application which must work also on PPC 2002. The problem was the function "ChangeDisplaySettingsEx" which is not included in 2002. These new functions should be implemented without static DLL library.
Here is my solution:

Code: [Select]

type
 TCGDExFunction = function(lpszDeviceName:LPCTSTR; lpDevMode:LPDEVMODE; hwnd:HWND; dwflags:DWORD; lParam:LPVOID):LONG; cdecl;

var
 MyChangeDisplaySettingsEx: TCGDExFunction;

procedure SafeRotateScreen;
var h: cardinal;
begin
 h := LoadLibrary('coredll.dll');
 MyChangeDisplaySettingsEx := TCGDExFunction(GetProcAddress(h,'ChangeDisplaySettingsEx'));
 FreeLibrary(h);
 if MyChangeDisplaySettingsEx = nil then exit;
 // else code to rotate the screen                    
 // .......
 // .......
end;

Nilcemar [br]

  • Newbie
  • Posts: 3
Re: Lazarus and PocketPC 2002
« Reply #6 on: August 03, 2011, 05:45:26 am »
You can try the following:

1 - Debug and get a backtrace of the crash. Instructions in the wiki:

http://wiki.lazarus.freepascal.org/Windows_CE_Interface#Debugging_Windows_CE_software_on_the_Lazarus_IDE

or

2 - Comment the internal LCL code for CreateForm, rebuild the LCL and test the program again. Repeat until you isolate the cause. The CreateForm code is in lazarus/lcl/interfaces/wince/wincewsforms.pp

Search for TWinceWSCustomForm.CreateHandle


HELLO,   I CANT RUN MY APP ON POCKET PC 2002. IT ONLY GENERATES A LOG FILE ON APP FOLDER ON POCKETPC WITH THIS VALUES: please somebody helpme urgent because i need to run my app on ppc2002


[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000
  $0019AF90
  $00020310
TApplication.HandleException Access violation
  Stack trace:
  $00000000
  $0019AF90
  $00020310
[FORMS.PP] ExceptionOccurred
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000
  $0019AF90
  $00020310
TApplication.HandleException Access violation
  Stack trace:
  $00000000
  $0019AF90
  $00020310
[FORMS.PP] ExceptionOccurred

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Lazarus and PocketPC 2002
« Reply #7 on: August 04, 2011, 12:55:45 pm »
I see that Lazarus applications do not work under PocketPC 2002 (both using LCL or KOL) under my IPAQ 3760. They instead work well under WM5.
Check if newer OS image is available for your device (HP or Motorola/Symbol).

Quote
Is it possible to define a standard WinMain function and strip all the LCL code away? Maybe using fpc without Lazarus?
Check fpGUI: http://wiki.lazarus.freepascal.org/fpGUI_Interface

I suggest you to create single form application with just close button and see if that simple test can pass. First with LCL, and if that doesn't work then do the same with fpGUI.

If earlier mentioned debugging techniques from some reason do not work for you , then you could try simple logging to textual file after each line in your LPR file after it is initialized. You should test that on your development platform first to be sure it behaves as imagined, and then try it on your mobile platform. Check this link: http://www.lazarus.freepascal.org/index.php/topic,7062.0.html
« Last Edit: August 04, 2011, 01:02:32 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Lazarus and PocketPC 2002
« Reply #8 on: August 04, 2011, 02:25:27 pm »
Is PPC 2002 unsupported? And 2003? Does it work?
I have a PocketPC 2003SE on my Garmin PDA. I have successfully created and ran my FPC+fpGUI based applications without problems.

Is it possible to define a standard WinMain function and strip all the LCL code away? Maybe using fpc without Lazarus?
I would suggest to simply use something like fpGUI Toolkit directly (http://fpgui.sourceforge.net). It is very easy to use and produces much smaller executables than with LCL. Creating a custom theme to blend in with PocketPC 2003SE is on my todo list, and should actually be very easy to do yourself. I just haven't had time to get to doing it.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Lazarus and PocketPC 2002
« Reply #9 on: August 04, 2011, 09:55:29 pm »
See the WinCE minimal distro here for a very easy way to test fpGUI on your device:
  http://www.turbocontrol.com/easyfpgui.htm
Regards,
Paul Breneman
www.ControlPascal.com

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Lazarus and PocketPC 2002
« Reply #10 on: November 10, 2011, 04:10:57 pm »
I see that Lazarus applications do not work under PocketPC 2002 (both using LCL or KOL) under my IPAQ 3760. They instead work well under WM5.
Check if newer OS image is available for your device (HP or Motorola/Symbol).

There is an option to upgrade Symbol device to Pocket PC 2003. Check my answer here:
http://www.lazarus.freepascal.org/index.php/topic,14091.msg74346.html#msg74346
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

paulahendricks

  • Newbie
  • Posts: 1
Re: Lazarus and PocketPC 2002
« Reply #11 on: January 07, 2012, 03:12:08 pm »
I'm a newbie here & I just would like to know if Lazarus is supported in my IPAQ hw6940? thanks & more power!

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus and PocketPC 2002
« Reply #12 on: January 07, 2012, 05:00:33 pm »
This website says it is Windows Mobile 5.0

http://reviews.cnet.com/smartphones/hp-ipaq-hw6940-mobile/4507-6452_7-31762522.html?tag=mncol;subnav

So yes, Lazarus supports it via LCL-WinCE.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11455
  • FPC developer.
Re: Lazarus and PocketPC 2002
« Reply #13 on: January 07, 2012, 07:23:18 pm »
Please, if you say it works for you (or not), mention the FPC and Lazarus versions (and KOL, FPGUI where applicable) that you use.


felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus and PocketPC 2002
« Reply #14 on: January 07, 2012, 08:26:39 pm »
Please, if you say it works for you (or not), mention the FPC and Lazarus versions (and KOL, FPGUI where applicable) that you use.

To whom is this message directed to? I can make 2 guesses:

1> To me, but then it makes not much sense

2> To paulahendricks, but she didn't even test from what I get. And she also hijacked an old thread. Paula, please create new threads for new questions in the future.

 

TinyPortal © 2005-2018