Forum > PDAs and Smartphones

WinCE tutorials and compiling problems

(1/2) > >>

I decided to play around with developing for Win CE; knowing the hazzle in Palm and Symbian development, I thought it would be nice to have good old Lazarus deal with it ;)

First thing I noticed though was that the tutorial was helpful in small parts, but since it seems targeted at stand-alone FPC, it was quite difficult to implement for Lazarus (it also contained wrong paths even for simple FPC and all that). So I've been protocolling my steps in our local Wiki to have a tutorial especially for Lazarus, and I was partly successful so far. I've got a few topics though I could use help on (I'm absolutely new to the Pocket PC OS, the device is a Compaq iPAQ H3870 running Pocket PC 2002, just after a hard reset):

* (updated) Installed PocketCmd, which didn't run until I installed PocketConsole as well (maybe should be mentioned in the wiki tutorial?). Then I started the test.exe both from command line and the file manager - the console/file manager just complete hangs, I have to do a reset to get them to react again (killing the task does not work).

Now I guess I could skip command line apps and go to a GUI app right away, but while Lazarus is all set up, when compiling a form with an edit and a button (widgetset, os, processor and compiler correctly set), I receive a (edit: both with Lazarus and a simple ppcrossarm projectname.lpr)

--- Code: ---C:\apps\Lazarus\lcl\units\arm-wince\LCLStrConsts.o: file not recognized: File format not recognized
--- End code ---

I did compile the LCL according to the tutorial:

--- Code: ---C:
cd \Apps\Lazarus
make lcl LCL_PLATFORM=wince PP=ppcrossarm.exe CPU_TARGET=arm OS_TARGET=wince
--- End code ---

And the IDE doesn't complain about any missing files etc.. I also created the fpc.cfg a bit more complex than the tutorial:

--- Code: --- -Twince
--- End code ---

because I decided to mirror the structure of i386-win32 instead of just putting all files into the same folder like in the tutorial.

So, my questions:
* Does that stuff above run on a Pocket PC 2002 device at all?
* How do I get it to run if it does?
* Where's the problem in Lazarus with the file format?

I got PocketCmd to work as well as some other apps, so the device seems to work (see above edit).

I checked the compiled test.exe, and inside the .data segment, it displays FPC 2.1.1 [2006/06/08] for arm - WinCE, so it's at least the correct compiler (.rdata and .pdata segments also wouldn't appear in ppc386 compile).
The import table shows usage of coredll.dll instead of the Win32 dlls, so I assume the correct libraries have been linked.

Still can't get either the simple command line thing (hangs) to run on the device nor Lazarus to compile  :(

I don't know what the problem is, but I can tell you that test.exe hangs exactly the same way on my ipaq 3850 running Windows Mobile 2003, so whatever the problem is, it's not a Pocket PC 2002 issue. I'm pretty the stuff should run perfectly well on PPC 2002.

I'm going to set up the wince stuff from scratch again, and try to see if I did something wrong last time around :(.

Thanks for the answer! Knowing that test.exe won't necessarily work already helps a lot ;)
Meanwhile I installed the emulator on another machine (main machine is 64 bit, there the emulator won't sync with ActiveSync since the network driver for the emulator is 32 bit only), and actually got it to compile!

I posted my way of getting Lazarus to do WinCE in my Wiki user page (primarily because I also had it formatted in Wiki style for our internal Wiki and didn't want to adjust to the forum first *g*). It seems that either because this other machine is 32 bit (but Win32 Lazarus also compiles on Win64), or because I made paths all lowercase this time, it now works. Well, works means that there now is a 15 MB executable that's showing to be a WinCE app in its PE headers; I've neither got the device nor the emulator here to test, but will do so asap tomorrow ;)

Well, GUI application works quite fine on emulator and device, that's great!
I'll probably write a Win-Lazarus mini-app for automating all the installation steps right now, to be able to repeat it quickly with new versions ;)

My questions:
1. How can I get a "normal" window; "normal" meaning auto alignment to maximal window size and window title in the common place?
2. Is there a workaround for the exit-only-after-another-click bug?
3. How do I reduce the file size (can I also use smart-linking? GUI option for that won't help)?
4. FindFirst/FindNext won't work with the Windows folder or some files in there, is there maybe another special attribute that would be needed to be included in faAnyFile on WinCE?

And a few other things I noticed using WinCE:
* Rotating the display, alignments (alTop, alClient) etc. won't be used
* WindowState = wsMaximized does minimize the window to title only
* While normally the Windows menu is at the top, a Lazarus app will move the Windows menu to the bottom with its own header on top.
* MessageDlg is not modal, and in the background
* TCustomForm.ShowModal does not draw correctly; buttons of new form get overlayed over old form, only when focusing a button the whole form appears.
* TLabel.Font.Size = 0 is different from other font sizes; had to manually adjust them to 9.


[0] Message Index

[#] Next page

Go to full version