Difference between revisions of "Windows CE Development Notes"

From Free Pascal wiki
Jump to navigationJump to search
Line 1: Line 1:
 
==Debugging your applications==
 
==Debugging your applications==
[[fpc:Windows_CE_Interface#Debbuging Windows CE software on the Lazarus IDE]]
+
General infos are here [[Windows_CE_Interface#Debbuging Windows CE software on the Lazarus IDE]]
 +
 
 
-Sometimes gdb will crash,nothing to worry,just reset debugger and start again.
 
-Sometimes gdb will crash,nothing to worry,just reset debugger and start again.
  

Revision as of 11:45, 23 April 2006

Debugging your applications

General infos are here Windows_CE_Interface#Debbuging Windows CE software on the Lazarus IDE

-Sometimes gdb will crash,nothing to worry,just reset debugger and start again.

-If you have an open call stack window it will take lots of time each time you trace/debug your program and sometimes crashes the debugger,so use it only when needed.

-Always put breakpoints where needed you can not/or hardly can pause your program or even stop/reset it.

-You can strip your program with --only-keep-debug which save you around 1mg.

-Somethimes stepping takes lots of time,just be patinent,i've experienced once a simple assignment took 1min for debugger to execute that code.

Other Stuff

Well i dont know what call the following but these are things i know,and i thought you might know too! Menues

They require some extensive work.Need a little more background on how lcl handle menus and maybe some modifications to that too!

GetSysColor

This function is changed with flags ored with $40000000(becouse wince expect that) but i think the original values in sdk should be changed from windows and lcltypes units.Take a look at windows.h from pocketpc 2003 sdk. for example in lcltype COLOR_MENU = 4; but it should be like COLOR_MENU = 4 or SYS_COLOR_INDEX_FLAG; and {$ifdef wince}SYS_COLOR_INDEX_FLAG = $40000000;{$else}SYS_COLOR_INDEX_FLAG = 0{$endif} But changing these makes some other internal functions work wrong.If this approach choosed they need to be fixed.

Copy-pasted win32 code

Well yes wince interface is working,with not that much known bugs,but i think by removing and changing lots of current codes we can make wince interface faster and better.

Known Issues and bugs

SetProp - GetProp - RemoveProp APIs

Windows CE does not have SetProp and GetProp apis which is used a lot.So I have created/emulated those myself. The current implementation is not exactly as win32 apis.In win32 you can set multiple properties with diffrent names to each window but in wince names are just ignored so we only have one.(it is easy to implement that but i find it currently of no use) Also removeprop is not called yet!so a memory leak happens each time you exist the program.(i dont know if wince also frees memory itself or not when handles are destroyed..)

Exiting Programs

After you clicked the X exit button,you have to do something -like clicking somewhere-to make program exit. Reason not yet known.

LCLControlSizeNeedsUpdate LCLBoundsToWin32Bounds LCLFormSizeToWin32Size GetLCLClientBoundsOffset GetLCLClientBoundsOffset

I havent even bothered myself to know are these woking or not.I also dont think we need them as they exist in win32.So might require some redesigning.For example in TWinCEWSWinControl.SetBounds i had to remove movewindow becouse it moved it to nowhere.

Brushes

We dont have them as they are in win32,i've mapped CreateBrushIndirect to CreateSolidBrush and CreateDIBPatternBrushPt,other flags-if used in lcl-will fail.


Links

Here are some link that migh be usefull in creating windows ce interfaces

How to Port Your Win32 Code to Windows CE

Old but usefull article show flags required for creating wince controls

Page with cice descriptions of lots of flags

Adapting Application Menus to the CE User Interface