[Lazarus] RE : WinCE and version

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Jul 4 10:25:17 CEST 2012


On Wed, Jul 4, 2012 at 9:58 AM, Antonio Fortuny
<a.fortuny at sitasoftware.lu> wrote:
> I've omitted that there is some conditional code as
> {$IFDEF WINCE}
>   BufferSize := GetFileVersionInfoSize(PWideChar(sProgram),nHWnd); {Get
> buffer size}
>   AddLog(Format('WinCE buffersize:%d', [BufferSize]));
> {$ELSE}

Did you notice that you are type-casting a string to a PWideChar?
Maybe the compiler does special hidden conversions to make this work,
but I would not be so reliant on hidden behaviors.

If I were you I would do it like this:

var
  wProgram: widestring;
begin
  wProgram := UTF8ToUTF16(sProgram); // or whatever other desired
conversion routine

 {$IFDEF WINCE}
   BufferSize := GetFileVersionInfoSize(PWideChar(wProgram),nHWnd);

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list