[fpc-devel] Widestrings in win32

2007-06-16 Thread Martin Schreiber
Hi,
It seems that CG plans to implement an non BSTR widestring type for win32:
http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7caeced42f1934a4?hl=en;

The introduced string handling for the Unicode VCL is equivalent to the 
string handling in MSEgui BTW.

Martin
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Daniël Mantione


Op Sat, 16 Jun 2007, schreef Martin Schreiber:

 Hi,
 It seems that CG plans to implement an non BSTR widestring type for win32:
 http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7caeced42f1934a4?hl=en;
 
 The introduced string handling for the Unicode VCL is equivalent to the 
 string handling in MSEgui BTW.

Noted. As COM incompatibilty seems preferable over not working 
widestrings, shall I disable the winlikewidestring in 2.1.5?

Can someone reply Allan Bauer about using ptrint, and better, ptruint 
(explain pitfalls). It seems I have been banned from that newsgroup 
yesterday, without any apparent reason :(

Daniël___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Martin Schreiber
On Saturday 16 June 2007 08.57, Daniël Mantione wrote:
 Op Sat, 16 Jun 2007, schreef Martin Schreiber:
  Hi,
  It seems that CG plans to implement an non BSTR widestring type for
  win32:
  http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7ca
 eced42f1934a4?hl=en
 
  The introduced string handling for the Unicode VCL is equivalent to the
  string handling in MSEgui BTW.

 Noted. As COM incompatibilty seems preferable over not working
 widestrings, shall I disable the winlikewidestring in 2.1.5?

I would appreciate very much. If you can do so, I could restart the testing 
and debugging  of FPC 2.2.

 Can someone reply Allan Bauer about using ptrint, and better, ptruint
 (explain pitfalls). It seems I have been banned from that newsgroup
 yesterday, without any apparent reason :(

Please post on this list what you want to write to him, I'll try to feed 
forward.

Martin
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Daniël Mantione


Op Sat, 16 Jun 2007, schreef Martin Schreiber:

 On Saturday 16 June 2007 08.57, Daniël Mantione wrote:
  Op Sat, 16 Jun 2007, schreef Martin Schreiber:
   Hi,
   It seems that CG plans to implement an non BSTR widestring type for
   win32:
   http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7ca
  eced42f1934a4?hl=en
  
   The introduced string handling for the Unicode VCL is equivalent to the
   string handling in MSEgui BTW.
 
  Noted. As COM incompatibilty seems preferable over not working
  widestrings, shall I disable the winlikewidestring in 2.1.5?
 
 I would appreciate very much. If you can do so, I could restart the testing 
 and debugging  of FPC 2.2.

I made the change, could you please test for any problems, as we are 
really close to 2.2.0.

  Can someone reply Allan Bauer about using ptrint, and better, ptruint
  (explain pitfalls). It seems I have been banned from that newsgroup
  yesterday, without any apparent reason :(
 
 Please post on this list what you want to write to him, I'll try to feed 
 forward.

Something like this?

Note that casting pointers to signed values is often a bad idea, since 
the virtual address space on a 32-bit system is often 3 gigabytes, i.e. 
pointers can have values between $8000..$c000. A signed type 
causes trouble in pointer value comparisons (like if pq then).

In Free Pascal there already exist two types ptrint and ptruint (signed 
and unsigned) for this purpose, you might want to recycle them especially 
as many people are currently using constructions like:

{$ifndef FPC}
type ptruint=longword;
{$endif}

... in order to be able to get their code to work on Win64 using FPC; this 
will make it easier for people to switch back to Delphi for 64-bit 
development when it is ultimately released.

Daniël___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Martin Schreiber
On Saturday 16 June 2007 10.10, Daniël Mantione wrote:
 I made the change, could you please test for any problems, as we are
 really close to 2.2.0.

Thanks, I start to work.

 Something like this?

[...]
Posted to delphi.non-tech.

Martin
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Micha Nelissen
Martin Schreiber wrote:
 Hi,
 It seems that CG plans to implement an non BSTR widestring type for win32:
 http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7caeced42f1934a4?hl=en;
 
 The introduced string handling for the Unicode VCL is equivalent to the 
 string handling in MSEgui BTW.

Widestring remains the COM compatible one AFAICS, and there is a new
UnicodeString that maybe has ref counting features. I quote:

WideString will remain a BSTR for use in interoperating with COM.  The
good thing is that the conversions between BSTRs and UnicodeStrings is
much more simple and straight forward...

Micha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Micha Nelissen
Daniël Mantione wrote:
 {$ifndef FPC}
 type ptruint=longword;
 {$endif}
 
 ... in order to be able to get their code to work on Win64 using FPC; this 

You mean to let it compile on delphi (win32), while porting the code to
win64 using FPC. It would compile on FPC anyway.

Micha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Florian Klaempfl
Daniël Mantione schrieb:
 
 Op Sat, 16 Jun 2007, schreef Martin Schreiber:
 
 On Saturday 16 June 2007 08.57, Daniël Mantione wrote:
 Op Sat, 16 Jun 2007, schreef Martin Schreiber:
 Hi,
 It seems that CG plans to implement an non BSTR widestring type for
 win32:
 http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7ca
 eced42f1934a4?hl=en

 The introduced string handling for the Unicode VCL is equivalent to the
 string handling in MSEgui BTW.
 Noted. As COM incompatibilty seems preferable over not working
 widestrings, shall I disable the winlikewidestring in 2.1.5?

 I would appreciate very much. If you can do so, I could restart the testing 
 and debugging  of FPC 2.2.
 
 I made the change, could you please test for any problems, as we are 
 really close to 2.2.0.

You're aware of the fact that this breaks a lot of code especially
delphi compatible one? (Ole)Variants on windows are probably broken too.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Daniël Mantione


Op Sat, 16 Jun 2007, schreef Florian Klaempfl:

 Daniël Mantione schrieb:
  
  Op Sat, 16 Jun 2007, schreef Martin Schreiber:
  
  On Saturday 16 June 2007 08.57, Daniël Mantione wrote:
  Op Sat, 16 Jun 2007, schreef Martin Schreiber:
  Hi,
  It seems that CG plans to implement an non BSTR widestring type for
  win32:
  http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7ca
  eced42f1934a4?hl=en
 
  The introduced string handling for the Unicode VCL is equivalent to the
  string handling in MSEgui BTW.
  Noted. As COM incompatibilty seems preferable over not working
  widestrings, shall I disable the winlikewidestring in 2.1.5?
 
  I would appreciate very much. If you can do so, I could restart the 
  testing 
  and debugging  of FPC 2.2.
  
  I made the change, could you please test for any problems, as we are 
  really close to 2.2.0.
 
 You're aware of the fact that this breaks a lot of code especially
 delphi compatible one? (Ole)Variants on windows are probably broken too.

Yes I am. This is an emergency measure; incompatible widestrings are 
preferable over broken widestrings, which totally blocks the usability of 
FPC 2.1+ for for Martin. I am fully aware of the consequences; all code 
which does something with OLE will not function.

Daniël___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Marco van de Voort
 Op Sat, 16 Jun 2007, schreef Martin Schreiber:
 
  Hi,
  It seems that CG plans to implement an non BSTR widestring type for win32:
  http://groups.google.ch/group/borland.public.delphi.non-technical/msg/7caeced42f1934a4?hl=en;
  
  The introduced string handling for the Unicode VCL is equivalent to the 
  string handling in MSEgui BTW.
 
 Noted. As COM incompatibilty seems preferable over not working 
 widestrings, shall I disable the winlikewidestring in 2.1.5?

Not working? Why is widestring not working? Moreover this would rule out
getting Delphi (existing Delphi) compatible in the 2.2 series?
 
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Widestrings in win32

2007-06-16 Thread Marco van de Voort
 Op Sat, 16 Jun 2007, schreef Marco van de Voort:
  
  Not working? Why is widestring not working? Moreover this would rule out
  getting Delphi (existing Delphi) compatible in the 2.2 series?
 
 When assigning two records/arrays/whatever type containing a 
 widestring to another the compiler:
 * Two pointers are pointing to the same widestring
 * One widestring is lost in memory as a memory leak
 
 Florian has written a proper fix.

Good, so now we are COM compatible again? This because I am planning to port
the OpenOffice bridge.

However that uses COM _and_ packages. (though I hope to get rid of the
need for pacakges)
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel