[Lazarus] WinCE and strings

Antonio Fortuny a.fortuny at sitasoftware.lu
Tue Jul 10 09:43:59 CEST 2012

Hi All.

Assuming that I'm modifying an application which
- will run on Win32 and WinCE (handheld device) (X-compilation, 2 targets)
- all string variables have previously been defined as String;
- WinCE (5.?) is UNICODE

Just to make sure that I'm on the right way, do you see someting wrong 
in the following sentences:

- all components using text (TLabel, TButton, TEdit, etc) use WideStrings
- I need to convert (using conditional code) from string to WideString 
when compiling for WinCE, like

function ShowSomething(const Msg: string): Boolean; <<<-------- 
unchanged function definition
   wStr: WideString;
   wStr: String;
   result := False;
   wStr := UnicodeString(msg);
   wStr := msg;
   ALabel.Caption := wStr;
// I  know, the Caption could be assigned immediately instead of passing 
through a variable
// this is just an example
   Result := True

Thanks for your remarks


More information about the Lazarus mailing list