Lazarus

Installation => PDAs and Smartphones => Topic started by: Sandeep Chandra on June 15, 2006, 12:56:59 pm

Title: WinCE progress
Post by: Sandeep Chandra on June 15, 2006, 12:56:59 pm
Hi

I was just wondering where is WinCE stuff at. I haven't seen much info regarding it in the forums lately. Where can I get latest info about WinCE stuff? How many people are working on this? I need answers as I will try to put my case to use Lazarus on WinCE to my boss who wants to use CF. Should I really be pushing  Lazarus against CF for PDA development.

It would be great if someone could shed some light on following:
1. Can I write a commercial application using Lazarus?
2. Will I own the source code or will I have to open source it?
3. Can I sell these applications?

Thanks is advance.

Sandeep
Title: RE: WinCE progress
Post by: Lord_ZealoN on June 15, 2006, 02:23:15 pm
Well, I don't know who is involved in WinCe port, but you are helping to this project to growth, using it, reporting bugs, and of course, solving bugs through the Mantis BugTracking.

Quote
1. Can I write a commercial application using Lazarus?


Of course. I eat, drink and live like you ;)

Quote

2. Will I own the source code or will I have to open source it?


No, the code will have the licenses you want.
 
But, if you modify something about lazarus itself code or freepascal code (both GPLed), this improvements are opensource too.


Quote

3. Can I sell these applications?


This is like point 1, true? Well..yes, you can. If you want, you can sell Lazarus itself, but you must offer the source (in GPL license).

GPL (opensource) <> Free

Free as speak, not as a beer <- remember this.
Title: RE: WinCE progress
Post by: CCRDude on June 15, 2006, 02:38:16 pm
Well, the main arguments against using Lazarus+WinCE in a end-user project for me currently are twese things:
1. the forms/windows are not yet fully fitting (forms can be moved, sub-forms do not appear completely at first)
2. threads: I have a button that starts a thread doing something that takes longer. Sometimes the thread starts, sometimes not.
3. the app I'm working on runs (except for #2) in the emulator, but not on the device, where it terminates after less than a second.

BUT: wit Lazarus, I've seen improvements every other day, so I'm staying :D

Which leads me to a question: where best to discuss WinCE problems? Shouldn't the be a WinCE subforum here? ;) And where exactly would I report problems to which bugtracker?
Title: RE: WinCE progress
Post by: felipemdc on June 15, 2006, 03:40:04 pm
> Which leads me to a question: where best to discuss WinCE problems? Shouldn't the be a WinCE subforum here?

Yes, seams a good idea to me.

> Wink And where exactly would I report problems to which bugtracker?

You report bugs on the main bug tracker. It´s the link called "Bugs" on the left part of lazarus website. It takes you to this bug tracker: http://www.freepascal.org/mantis/main_page.php

Then you can submit a bug as either a bug on the compiler or a bug on lazarus.
Title: RE: WinCE progress
Post by: CCRDude on June 15, 2006, 05:14:07 pm
Ouch, how could I've missed that bug tracker link :D
Thanks, I'll probably get around to debugging this weekend and will try to use the bugtracker then :)
(it's a bit complicated currently since I've got one machine that can compile for ARM, one that does run the emulator, and one that can upload to a real device :D )
Title: WinCE progress
Post by: Sandeep Chandra on June 16, 2006, 03:45:01 am
Has anyone done an install for WinCE stuff yet?

Regards

Sandeep
Title: WinCE progress
Post by: Lord_ZealoN on June 16, 2006, 07:41:03 am
I will try in holidays next week.

Would be interesting if anyone compile it, disbribuite them to test.

I don't have time now to read the wiki page (compile, see errors why not compiled etc...etc..). But i have time to test in my ipaq.

I have HP iPaq 4150 (400mhz, 64 ram) with PocketPC 2003.
Title: WinCE progress
Post by: CCRDude on June 16, 2006, 10:35:35 am
I haven't created an installer yet, but I guess installers don't care whether the file came form Lazarus or some other development system ;)
A quick search showed this one (http://www.spbsoftwarehouse.com/products/ezsetup/?en) for example to create installers.
Title: WinCE progress
Post by: Lord_ZealoN on June 16, 2006, 11:02:39 am
well..but would be possible a zip distributed system to our test, true?

I know how works my ipaq. I don't need an installer (if don't need key registris etc.) to test it.

An installer would be interesting when lazarus WinCe port become stable.

As i mentioned, i don't had time to compile it. Can you send me the binaries you use to run lazarus in the emulator? I will test in my iPaq.
Title: Re: RE: WinCE progress
Post by: felipemdc on June 16, 2006, 02:22:03 pm
Quote
Well, the main arguments against using Lazarus+WinCE in a end-user project for me currently are twese things:
1. the forms/windows are not yet fully fitting (forms can be moved, sub-forms do not appear completely at first)


Another option if you need to develop immediately is to just use Free Pascal, and call the Windows API directly, just like you would do on c or c++

Quote
2. threads: I have a button that starts a thread doing something that takes longer. Sometimes the thread starts, sometimes not.


Ok, to isolate this bug we need to find out if it's on Lazarus or on the compiler.

Can you create a simple console application that uses threads and see if the bug still appears?

If threads on a console application are OK, then the problem is on Lazarus. If not, the problem is on the compiler.

Quote
3. the app I'm working on runs (except for #2) in the emulator, but not on the device, where it terminates after less than a second.


Console applications (acctually doesn't have to be console, but I mean an application that doesn't use anything from Lazarus) work on your device?

thanks,

Felipe
Title: RE: Re: RE: WinCE progress
Post by: CCRDude on June 17, 2006, 12:14:00 pm
First, my environment: I updated my steps to install the arm-wince (did a fresh installation today), and even created a batch file that will do everything after downloading and extracting the three necessary archives; see the User:CCRDude (http://wiki.lazarus.freepascal.org/index.php/User:CCRDude) page of the wiki.

For testing command lines, I tried both PPC Command Shell and PocketCmd+PocketConsole, along with the most simple test.pas from the wiki (http://www.freepascal.org/wiki/index.php/WinCE_port).

* Microsoft Device Emulator 2.0 Preview using Microsoft Windows Mobile 5.0 MSFP Emulator Images: test-wince.exe without one of the above installed just tells me "A critical component is either missing or cannot start"; same with console.dll copied into the Windows folder. But since even PocketCMD itself won't work, I'm not sure if it has anything to do with that.

* Compaq iPAQ H3870 running PocketPC 2002 (WinCE 3.0): i compiled test.pas anew with todays installation, but still the same effect: the hourglass appears and keeps rotating forever (meaning hours!), and after that I can't use the File Explorer (or PocketCmd if I started it from there) until I do a soft reset of the device.

Looking into the data segment of the compiled files, they've been using FPC 2.1.1 [2006/06/10] for arm - WinCE (last installation, 32 bit Windows and machine) as well as [2006/06/17] (this installation, 64 bit Windows and machine). But cause the same error.

Win API sounds good, too. Like in the good old TPWin days when there was no Delphi yet :D But if I can't even get a provided test console app to run (imho someone mentioned the same problem in another topic), I doubt I would get an API-based GUI application to work  :cry:
Title: Re: RE: Re: RE: WinCE progress
Post by: tony72 on June 17, 2006, 01:12:55 pm
Quote from: "CCRDude"
...
But if I can't even get a provided test console app to run (imho someone mentioned the same problem in another topic), I doubt I would get an API-based GUI application to work  :cry:


I mentioned it, but I did subsequently manage to get the test console app to work. If you use the Lazarus Freepascal Program template, then add the  apptype console directive, it works (tested on my WM2003 ipaq 3850, haven't tested on the emulator). I haven't checked what makes the difference, but I suspect it's the {$mode objfpc}.

Edit: I just checked, all that's needed is to add the {$mode objfpc} directive.

Code: [Select]

program test;

{$mode objfpc}{$H+}
{$apptype console}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  { add your units here };

var
  Str: string;
begin
  WriteLn('Software Developed with:');
  WriteLn('The Free Pascal Compiler');
  WriteLn('');
  WriteLn('Please, enter your name:');
  ReadLn(Str);
  WriteLn('Your name is: ' + Str);
end.  
Title: RE: Re: RE: Re: RE: WinCE progress
Post by: CCRDude on June 17, 2006, 01:51:01 pm
Very interesting! Your file compiled with ppcrossarm test.pas still does not work, but using the Lazarus IDE to compile it, I get a file of the same size that works. Thanks a lot, I can now start trying some small GUI-API things and a test case for threads :)
Title: RE: Re: RE: Re: RE: WinCE progress
Post by: felipemdc on June 17, 2006, 02:31:37 pm
Ok, good that the compiler works =)

Another IDE for quickly building GUI app with Free Pascal + Windows CE:

http://wiki.lazarus.freepascal.org/index.php/User:Roozbeh#KOL_for_Wince

Apparently Roozbeh is porting KOL from Delphi to FPC+WinCE. KOL is a lightweight library to build gui apps, googling around you can find more info about it.

We can talk to him about how KOL port is progressing.
Title: RE: Re: RE: Re: RE: WinCE progress
Post by: CCRDude on June 17, 2006, 05:38:16 pm
I just took one of my own light-weight projects (creating a few controls and a message queue isn't that difficult :D ) and compiled it for CE. I was stuck for a few moments until I noticed that TWndClass may not use hCursor and lpszMenuName on CE, and CreateFontIndirect was not supported, but then it simply ran :)

The only minor annoyance is that the UI looks a bit "older" than the rest; the device is only CE 3.0, but stil, the Close button in the title bar in normal apps is an X in a round circle, in this simple app it's in a grey box. It does show the "correct" close button on the emulator (Mobile 5.0) though.
The window not the style I was looking at (same as File Explorer - not moving the Start menu to the bottom), but I guess that's part of the style parameter used in CreateWindow - I'll have to find out what is the "usual" setting on CE there (the SDK help isn't helpful regarding that - I thought I should use WS_EX_NODRAG, but that just returns an error that it cannot create a top-level child window - well, I'll find out :) ).

Anyway, now that I've got that running, I can see about the threads :)
Title: RE: Re: RE: Re: RE: WinCE progress
Post by: CCRDude on June 17, 2006, 08:03:57 pm
Update: the thread seems to be running fine this way! But I can't really test since now file operations are very unstable.

I've got a TStringList, and I use LoadFromFile to load a text file (path correct). One should think that this is simple - but every second time or so, I get an EFOpenError exception - every other time it just loads. I replaced the mystringlist.LoadFromFile with a filestream that I opened with fmOpenRead and fmOpenShareDenyNone, and then used mystringlist.LoadFromStream, but this also throws an exception every second time.

At least this problem did not happen when I used the full Lazarus version ;)


Code: [Select]
procedure TMyApp.DoLoadButton;
var sl: TStringList;
    i: integer;
begin
   ClearListBox(hList);
   sl := TStringList.Create;
   sl.LoadFromFile(ExtractFilePath(ParamStr(0))+'test.txt');
   sl.Free;
   for i := 0 to Pred(sl.Count)
    do AddListBoxItem(hList,sl[i]);
end;


* DoLoadButton is an event handler called when pressing a button on the form
* AddListBoxItem is my mini frameworks function to add strings to a ListBox, and works on other buttons
* test.txt is an existing file, the error message shows the correct path:

An unhandled exception occured at $000.....: EFOpenError: Unable to open file "\Storage Card\test\test.txt" $000.....

At the same time, using AssignFile, Reset, Read, CloseFile works - so there's probably some kind of problem in higher level file routines!

(update: submitted a bug to the bugtracker, category RTL, with a most simplified test application)
Title: RE: Re: RE: Re: RE: WinCE progress
Post by: CCRDude on June 23, 2006, 09:50:37 pm
Just to update for those who use the search function ;) :
The file bug was already fixed in Subversion, and for getting real fullscreen, there's this function:

Code: [Select]
const SHFS_SHOWTASKBAR = $1;
      SHFS_HIDETASKBAR = $2;
      SHFS_SHOWSIPBUTTON = $4;
      SHFS_HIDESIPBUTTON = $8;
      SHFS_SHOWSTARTICON = $10;
      SHFS_HIDESTARTICON = $20;

function SHFullScreen(hwmdRequester: hWnd; dwState: DWord): WINBOOL; external UserDLLAyg name 'SHFullScreen';


I guess it should be in a future version of aygshell.inc ;)

This allows to use the two buttons at the bottom created by SHCreateMenuBar (with SHFullScreen and the appropriate parameters, they will only show on smartphones, not regular devices).
TinyPortal © 2005-2018