Recent

Author Topic: WinCE & archives  (Read 57124 times)

Anonymous

  • Guest
WinCE & archives
« Reply #15 on: July 03, 2006, 10:30:06 am »
Hi

I still am not having any success with this thing.

I am getting following error

`sub'
..\..\rtl\units\arm-wince\system.s:54879: Error: no such instruction: `b SYSTE
TINTERFACEDOBJECT_$__QUERYINTERFACE$TGUID$formal$$LONGINT'
..\..\rtl\units\arm-wince\system.s:54884: Error: too many memory references fo
`sub'
..\..\rtl\units\arm-wince\system.s:54885: Error: no such instruction: `b SYSTE
TINTERFACEDOBJECT_$___ADDREF$$LONGINT'
..\..\rtl\units\arm-wince\system.s:54890: Error: too many memory references fo
`sub'
..\..\rtl\units\arm-wince\system.s:54891: Error: no such instruction: `b SYSTE
TINTERFACEDOBJECT_$___RELEASE$$LONGINT'
system.pp(1073,24) Error: Error while assembling exitcode 1
system.pp(1073,24) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
make[3]: *** [system.ppu] Error 1
make[3]: Leaving directory `C:/apps/Lazarus/pp/rtl/wince'
make[2]: *** [wince_all] Error 2
make[2]: Leaving directory `C:/apps/Lazarus/pp/rtl'
make[1]: ***
Error 2
make[1]: Leaving directory `C:/apps/Lazarus/pp/compiler'
make: *** [cycle] Error 2
------------------------------------------------------------------------
If you don't see any error messages, you may now continue.
------------------------------------------------------------------------
Press any key to continue . . .

Could someone zip the complete C:\Apps folder so that I can atleast try this thing! It might be big so zipping using 7zip might be ok.

I am going nuts trying to compile this thing!

Regards

Sandeep

CCRDude

  • Hero Member
  • *****
  • Posts: 596
WinCE & archives
« Reply #16 on: July 03, 2006, 11:09:51 am »
@Bernd: If you had to copy the ARM files to this directory, you didn't add C:\Apps\Arm (or your choice) to the global system path. Seems I forgot to mention that ;) (changing it from the batch file will only change the current session, not the global path)

I've built a complete application with it, yes. The only thing missing is font support (I used my own framework, not the LCL, and font support for this is in work today :) ), everything else has been tested, and it will probably be released as an alpha version in the next days.

@Sandeep: I installed again today, without any problems. If you need to full thing, I'll do this on another machine during the day and upload to my webspace.

Anonymous

  • Guest
WinCE & archives
« Reply #17 on: July 03, 2006, 11:44:28 am »
CCRDude,
Quote from: "CCRDude"
@Bernd: If you had to copy the ARM files to this directory, you didn't add C:\Apps\Arm (or your choice) to the global system path. Seems I forgot to mention that ;) (changing it from the batch file will only change the current session, not the global path)

I try to keep the global system path as small as possible. I hope, I can sometimes throw out the (incompatible) borland stuff ;-)

Quote from: "CCRDude"
I've built a complete application with it, yes. The only thing missing is font support (I used my own framework, not the LCL, and font support for this is in work today :) ), everything else has been tested, and it will probably be released as an alpha version in the next days.

Thank you. I played a bit with the WinCE interface and got the impression, that this interface is still in an experimental state: Most of the controls appear on the form, the events seem to work. But when I tried to update a label caption in a for loop, the application crashed. Closing the main form doesn't seem to work. I would like to fix it myself, but don't have the skill to do it. The LCL interface stuff seems pretty complex.

Regards, Bernd.

CCRDude

  • Hero Member
  • *****
  • Posts: 596
WinCE & archives
« Reply #18 on: July 03, 2006, 12:37:05 pm »
Indeed... there was a workaround for the close bug somewhere... using fomrnamne.Close in the OnClose event of the form. Since I created my blog for WinCE hints, I posted it there, too.

Next post on the blog will probably a fullscreen workaround, because currently the LCL does display the main form in Windows CE 1.0/2.0 style with the start bar at the bottom, while in later versions, it moved to the top (needs two or three new functions only).

Not sure if I will make my own framework available, it's really very very basic - but if you don't want to use the LCL, a simple event loop and a few CreateWindowEx calls are all that is needed... maybe I should add a demo for that :)

edit: A workaround for the labels would be (I didn't have that problem, but anyway) to use the API function to change the text:
Code: [Select]
SetWindowText(labelname.Handle, PWideChar('Hello World'));

CCRDude

  • Hero Member
  • *****
  • Posts: 596
WinCE & archives
« Reply #19 on: July 04, 2006, 08:01:55 pm »
Sandeep, sorry that I did not provide a compiled version yet - the newest releases are all broken somewhat - I can't get valid PocketPC apps to compile with the newest FPC sources or Lazarus after June 24th... not yet quite sure why, did 5 or 6 installations today and am now back to Lazarus from June 24th with the subversion revision mentioned in the batch file, because that at least works ;)

Anonymous

  • Guest
WinCE & archives
« Reply #20 on: July 05, 2006, 09:13:15 am »
Its alright, I'll wait until you have a working copy.

Thanks

Sandeep

Anonymous

  • Guest
WinCE & archives
« Reply #21 on: July 07, 2006, 01:08:25 am »
Hi CCRDude

Any luck with new versions?

Sandeep

Anonymous

  • Guest
WinCE & archives
« Reply #22 on: July 07, 2006, 01:08:59 pm »
I just would like to know how many people are currently working on WinCE stuff? I haven't seen much progress and it seems that there is still a lot that has to be done for this to work properly on WinCE. I didn't was to use .Net for my next WinCE app but it looks like I have to.

Sandeep

CCRDude

  • Hero Member
  • *****
  • Posts: 596
WinCE & archives
« Reply #23 on: July 07, 2006, 08:17:45 pm »
Well, I have just today "finished" my first application (meaning there are no more bugs / missing features that have been found inhouse). I have used a small own GUI framework and not the LCL, but the compiler itself works great. And is already better than some commercial ones I've seen (CodeWarrior for Symbian for example is a mess).

I'm going to test the July 7th release now, and if that's broken still, I'll just upload an archive with the slighter older version (which doesn't show any bugs so far anyway).

edit: I just saw that there were new arm-wince-binutils on June 24th - newer Lazarus versions didn't work for me, mayhaps the newer depend on the newer binutils.

CCRDude

  • Hero Member
  • *****
  • Posts: 596
WinCE & archives
« Reply #24 on: July 07, 2006, 09:07:10 pm »
Ok, I'm finished testing. The new combination (arm-binutils from June 24th, Lazarus from July 7th, FPC soucres from July 6th) works quite well. Compiled my GUI test application and it works fine.

lazarus-arm-wince-20060707.7z (51 MB 7Zip archive)

Anonymous

  • Guest
WinCE & archives
« Reply #25 on: July 08, 2006, 12:42:42 am »
Could you please explain what you mean by

I have used a small own GUI framework and not the LCL

I have not been able to download the file from the link you posted. The connection timesout.

Regards

Sandeep

Anonymous

  • Guest
WinCE & archives
« Reply #26 on: July 08, 2006, 03:43:30 am »
Finally I have managed to compile my first app for WinCE. BUT it doesn't work in the emulator. It says "not a vlaid Windows CE application". The size of the app is around 8MB. If I try to run the app from IDE I get error saying "not in executable format...", that means it is compiling it for WinCE. It even says that when compiling (Free Pascal Compiler Version 2.1.1[2006/07/08] for arm). It compiles alright.

So what am I missing now?

Sandeep

CCRDude

  • Hero Member
  • *****
  • Posts: 596
WinCE & archives
« Reply #27 on: July 08, 2006, 09:44:56 am »
Sorry, the server has a flatrate at about 100/10 MBit/s, it's sometimes hard to reach it ;)

You need three or four settings, depending on what you intend to do (the following names are guessed, since Lazarus starts up in German here even though I want it in English :D ):
* Settings -> Environment Settings -> Compiler -> C:\Apps\lazarus\pp\bin\arm-wince\ppcrossarm.exe (I think you did this as the proper compiler was showing up)
* Project -> Compiler settings -> Paths -> LCL interface -> wince (only if you use the LCL)
* Project -> Compiler settings -> Source code -> Target platform -> Target OS -> WinCE
* Project -> Compiler settings -> Source code -> Target platform -> Target processor -> arm

It's probably the later two or three settings that are still missing, because I remember that message when switching between Win32 and WinCE and forgetting those ;)

What I meant by my own GUI framework is that I did not use Lazarus' GUI designer and an application of type Application, but a simple "Program", and wrote the event loop and control creation myself. That way, my apps are 3 MB, and after using strip, less than 1 MB, and I could implement a better fitting fullscreen mode.

I'll show you a very rough example (haven't really extracted that into a fully functional demo file yet):

Here's the main loop:
Code: [Select]
  while GetMessage(@msgMain,0,0,0) do begin
      TranslateMessage(@msgMain);
      DispatchMessage(@msgMain);
   end;


The event handler:
Code: [Select]
function WndMessageProc(hWnd: HWND; Msg: UINT; wParam: wPARAM; lParam: LPARAM): LongInt; stdcall;
var win: TMiniAppWindow;
    iIndex: integer;
    lw,hw: Word;
begin
   Result := 0;
   win := nil;
   for iIndex := 0 to Pred(Length(MessageProcHandles))
    do if MessageProcHandles[iIndex]=hWnd
     then win := MessageProcWindows[iIndex];
   case Msg of
      WM_CREATE: begin
         if Assigned(win)
          then win.DoCreate;
      end;
      WM_ACTIVATE: begin
         if Assigned(win)
          then win.DoActivate(Lo(wParam),Hi(wParam),lParam);
      end;
      WM_DESTROY: begin
         PostQuitMessage(0);
      end;
      WM_CLOSE: ;
      WM_NOTIFY: begin
         if Assigned(win)
          then win.DoNotify(wParam, PNMHDR(lParam));
      end;
      WM_SETTINGCHANGE: begin
         if Assigned(win)
          then win.DoSettingChange(wParam, PMiniChar(lParam));
      end;
      WM_NCCALCSIZE: begin
         if Assigned(win)
          then win.DoCalcSize;
      end;
      WM_COMMAND: begin
         lw := Lo(wParam);
         hw := Hi(wParam);
         if lw=IDOK then PostQuitMessage(0);
         if Assigned(win) then begin
            if lw>0
             then win.DoMenu(hw,lw);
            if lParam>0
             then win.DoCommand(lParam);
         end;
      end;
   end;
   Result := DefWindowProc(hWnd,Msg,wParam,lParam);
end;


And the creation of the main window:
Code: [Select]
var FWindowClass: TWndClass;
    FClassName: AnsiString;
    FWindowTitle: WideString;
    dwExStyle: DWord;
begin
   FClassName := 'mytestappwindow';
   FWindowTitle := 'My test app';
   FWindowClass.hInstance := hInstance;
   with FWindowClass do begin
      style := 0;
      hIcon := LoadIcon(hInstance,'MAINICON');
      lpfnWndProc := TWndMessageProc(@WndMessageProc);
      hbrBackground := COLOR_BTNFACE;
      lpszClassName := PWideChar((FClassName));
      cbClsExtra := 0;
      cbWndExtra := 0;
      {$IFDEF Win32}
      hCursor := LoadCursor(0,IDC_ARROW);
      lpszMenuName := '';
      {$ENDIF Win32}
   end;
   RegisterClass(FWindowClass);
   dwExStyle := WS_EX_NODRAG or WS_EX_NOANIMATION or WS_EX_CAPTIONOKBTN;
   FHandle := CreateWindowEx(dwExStyle, FWindowClass.lpszClassName,
      PWideChar(FWindowTitle), FWindowStyle,
      Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), 0, 0, hInstance, nil);
   if Handle = 0 then begin
      MessageBox(0, 'Could not create test app window!', 'Test app', MB_OK);
      UnRegisterClass(FWindowClass.lpszClassName, hInstance);
      Exit;
   end;


Add your controls using further CreateWindowEx calls, add events by associating the resulting handles with procedures and reacting on the window message handler.

Maybe I should create the complete example at all now that I've extracted the important parts anyway, will then post it on the blog ;)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
WinCE & archives
« Reply #28 on: July 08, 2006, 10:34:53 am »
Ok, I made a complete demo app out of that - 139 lines for a GUI including a button and a Hello World ;) available on my ccrdu.de blog.

Anonymous

  • Guest
WinCE & archives
« Reply #29 on: July 08, 2006, 03:24:08 pm »
Quote from: "CCRDude"

What I meant by my own GUI framework is that I did not use Lazarus' GUI designer and an application of type Application, but a simple "Program", and wrote the event loop and control creation myself. That way, my apps are 3 MB, and after using strip, less than 1 MB, and I could implement a better fitting fullscreen mode.

add -Xi -Xs -XX to your fpc.cfg in the pp\bin\arm-wince directory and you will get 1,3 MB for an compiled LCL project with an empty form.

A compiled WinCE API only program (a simple one) is about 60 KB small.

Regards, Bernd.

 

TinyPortal © 2005-2018