[fpc-pascal] Re: fpc-pascal Digest, Vol 26, Issue 35

2006-10-20 Thread Armando Navarro Vázquez
On Friday 20 October 2006 12:00, [EMAIL PROTECTED] wrote: It should be no problem to build a library, these are the interfaces These are the interfaces void mnbrak(float *ax, float *bx, float *cx, float *fa, float *fb, float *fc, float (*func)(float)); float golden(float ax, float bx, float cx,

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Felipe Monteiro de Carvalho
On 10/20/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: Did you include cwstring as first unit in your project? thanks, I didn't know I had to. -- Felipe Monteiro de Carvalho ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Felipe Monteiro de Carvalho
On 10/20/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: Did you include cwstring as first unit in your project? Oh, that doesn´t work. I forgot to mention I am on Windows, where this unit isn´t available. -- Felipe Monteiro de Carvalho ___ fpc-pas

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Vincent Snijders
Felipe Monteiro de Carvalho schreef: On 10/20/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: Did you include cwstring as first unit in your project? Oh, that doesn´t work. I forgot to mention I am on Windows, where this unit isn´t available. And isn't needed. The windows system unit does

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Vincent Snijders
Felipe Monteiro de Carvalho schreef: Hello, I am having a problem with string conversion from utf-8 to utf-16: procedure TForm1.Button6Click(Sender: TObject); var WideText: PWideChar; AText: string; Size: Integer; begin AText := 'Meu longo texto iso-8859-1'; Size := Utf8ToUnicode(nil, PCha

[fpc-pascal] Problem with string conversion

2006-10-20 Thread Jason P Sage
>> I am having a problem with string conversion from utf-8 to utf-16: >> >> procedure TForm1.Button6Click(Sender: TObject); >> var >> WideText: PWideChar; >> AText: string; >> Size: Integer; >> begin >> AText := 'Meu longo texto iso-8859-1'; >> Size := Utf8ToUnicode(nil, PChar(AText),

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Felipe Monteiro de Carvalho
On 10/20/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: This should be WideText := GetMem(Size*2); because you get the number of characters, and the number of bytes 2* number of characters. Thanks, it works, but I still have doubts. 1) On linux I will need that cwstring unit, right? This w

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Vincent Snijders
Felipe Monteiro de Carvalho schreef: On 10/20/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: This should be WideText := GetMem(Size*2); because you get the number of characters, and the number of bytes 2* number of characters. Thanks, it works, but I still have doubts. First of all, I

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Felipe Monteiro de Carvalho
Ok, I looked at the source code of Utf8ToUnicode and I can answer some of my questions: 3) Shouldn´t we allocate Size * 2 + 2? I mean, we did not allocate space for the null-terminator. Utf8ToUnicode returns a size that already counts the extra null-terminator it appends to the string. 4) He

Re: [fpc-pascal] mixing C and Pascal and function pointers

2006-10-20 Thread Ken G. Brown
I've been experimenting with calling C routines in a library from Pascal. This seems to work: In the Pascal source do Procedure croutine; cdecl; alias : '_croutine'; External; If there is trouble finding the routines when building, you can give the location of the routines in the Pascal so

Re: [fpc-pascal] Problem with string conversion

2006-10-20 Thread Marc Weustink
Felipe Monteiro de Carvalho wrote: > On 10/20/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: >> This should be >>WideText := GetMem(Size*2); >> because you get the number of characters, and the number of bytes 2* >> number of >> characters. > > Thanks, it works, but I still have doubts. > >

[fpc-pascal] Qt4 binding ported to 64bit

2006-10-20 Thread Den Jean
Hi, FYI: thanks to a patch from Giulio Berna, the Qt4 binding now also works on 64 bit platforms ( ifdef _LP64... ) Important note from Giulio: there is a bug on fpc 2.0.4 that prevents parameters to be passed correctly to C functions on x86_64 (http://www.freepascal.org/mantis/view.php?id=76

Re: [fpc-pascal] Qt4 binding ported to 64bit

2006-10-20 Thread Florian Klaempfl
Den Jean schrieb: What do you think about integrating the qt4 stuff into the fpc svn repository? Of course, you would get svn write access to maintain the pacakge. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.or

Re: [fpc-pascal] Qt4 binding ported to 64bit

2006-10-20 Thread Felipe Monteiro de Carvalho
If that is the case it would be even better if qtopia stuff was added too. And even much better if qtopia was added too. Is it possible to have 1 qt4.pas file for qtx11, qtwin, qtmacosx and qtopia (or qt/embedded)? thanks, -- Felipe Monteiro de Carvalho __