Re: [Lazarus] [again] Can't take the address of constant expressions

2011-06-09 Thread michael . vancanneyt
On Thu, 9 Jun 2011, John Repucci wrote: I was testing the below code from the fpc documentation and I get the "Can't take the address of constant expressions" error, with the cursor positioned just after "(S)" in the 2nd WriteLn statement. I do not understand how to fix this. I did search fo

Re: [Lazarus] thread safe (was: How to PostMessage to object?)

2011-06-09 Thread Mattias Gaertner
On Fri, 10 Jun 2011 03:09:07 +0200 Hans-Peter Diettrich wrote: > Mattias Gaertner schrieb: > > > Only if the documentation explicitly says a method is thread safe it is. > > Maybe this needs to be made more clear. Any ideas, where? > > What is "thread safe"? http://lmgtfy.com/?q=thread+safe&l

[Lazarus] [again] Can't take the address of constant expressions

2011-06-09 Thread John Repucci
I was testing the below code from the fpc documentation and I get the "Can't take the address of constant expressions" error, with the cursor positioned just after "(S)" in the 2nd WriteLn statement. I do not understand how to fix this. I did search for the error, but it none of it makes sense. I

Re: [Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread Maxim Ganetsky
10.06.2011 3:56, Rafael Tuim Elias пишет: That line been generated automaticaly in the fpc.cfg, by fpcmkcfg (in cmd typed: fpcmkcfg.exe -o c:\lazarus\fpc\2.5.1\.\bin\fpc.cfg ). With this line don't works. -Fu$LOCAL_APPDATA\FreePascal\fppkg/units/$FPCTARGET/* After change this line: to -F

Re: [Lazarus] Little interface improvement (i think so...)

2011-06-09 Thread Hans-Peter Diettrich
Flávio Etrusco schrieb: 2011/6/9 William Oliveira Ferreira : well i´ve read those links and i saw that with lazdockmangerdsn, it doesn't save window's size and positon. Someone faced this issue too? William de Oliveira Ferreira You have to explicitly save the l

Re: [Lazarus] thread safe (was: How to PostMessage to object?)

2011-06-09 Thread Hans-Peter Diettrich
Mattias Gaertner schrieb: Only if the documentation explicitly says a method is thread safe it is. Maybe this needs to be made more clear. Any ideas, where? What is "thread safe"? There are a few low level functions like FileExistsUTF8 which are thread safe and needs to be documented that th

Re: [Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread Rafael Tuim Elias
That line been generated automaticaly in the fpc.cfg, by fpcmkcfg (in cmd typed: fpcmkcfg.exe -o c:\lazarus\fpc\2.5.1\.\bin\fpc.cfg ). With this line don't works. -Fu$LOCAL_APPDATA\FreePascal\fppkg/units/$FPCTARGET/* After change this line: to -Fu C:\lazarus\fpc\2.5.1\units\i386-win32\* M

Re: [Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread Maxim Ganetsky
09.06.2011 20:45, Rafael Tuim Elias пишет: Hi Daniel Try to change this configurations in your "fpc.cfg" file. Find that line: -Fu$LOCAL_APPDATA\FreePascal\fppkg/units/$FPCTARGET/* and replace to -Fu C:\lazarus\fpc\2.5.1\units\i386-win32\* Hmm, did you get such line in your fpc.cfg after s

Re: [Lazarus] Dynamic loading of a custom sqlite library

2011-06-09 Thread Maxim Ganetsky
09.06.2011 13:17, Max Vlasov пишет: Finally found that this was because sqlite3 was in the uses list, so actually it was scenario when fpc linked sqlite dynamically and besides I did my own dynamic loading with my own unit of another version/file of sqlite. So probably there was a conflict with s

Re: [Lazarus] Fwd: Get the htdocs foldes from server host

2011-06-09 Thread silvioprog
2011/6/9 Leonardo M. Ramé : > It should be possible, in CGI there's an environment variable called > DOCUMENT_ROOT that contains the path you are asking for: Yes, thx. :) Code: [code] (...) AResponse.Content := '' + LineEnding + '' + LineEnding + '' + LineEnding + '' + LineEndi

Re: [Lazarus] Little interface improvement (i think so...)

2011-06-09 Thread Flávio Etrusco
2011/6/9 William Oliveira Ferreira : > well i´ve read those links and i saw that with lazdockmangerdsn, it doesn't > save window's size and positon. Someone faced this issue too? > > William de Oliveira Ferreira You have to explicitly save the layout using the menu

Re: [Lazarus] Fwd: Get the htdocs foldes from server host

2011-06-09 Thread Leonardo M . Ramé
On 2011-06-09 15:43:33 -0300, silvioprog wrote: > Hi. > > It's possible to get the htdocs foldes from server host via a app CGI? > > Eg., my htdocs is C:\xampp\htdocs, and my server host is http://localhost > > Thx. > > ps. Sorry for my bad english. ^^' > It should be possible, in CGI there's

[Lazarus] Fwd: Get the htdocs foldes from server host

2011-06-09 Thread silvioprog
Hi. It's possible to get the htdocs foldes from server host via a app CGI? Eg., my htdocs is C:\xampp\htdocs, and my server host is http://localhost Thx. ps. Sorry for my bad english. ^^' -- Silvio Clécio === Blog - Twitter - LazSolutions - Lazaru

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Krzysztof
Huh, 35 new messages in my topic :) . After reading all, maybe I summarize why I need post message to non-windowed object/component and why I can't use PostMessage and for what I need this (on a real example). So, I wrote TMyHTTPClient which is some kind of layer for synapse http client but it do

Re: [Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread lazarusportugalwebmast...@gmail.com
Em 09-06-2011 17:45, Rafael Tuim Elias escreveu: -Fu C:\lazarus\fpc\2.5.1\units\i386-win32\* Rafael ypu solve the problem. -- # #lazarus-br em irc.freenode.org Lazarus, o pascal ainda tem futuro. # Comunidade portuguesa Lazarus, Delphi, Lazarus e Pascal.

Re: [Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread Rafael Tuim Elias
Hi Daniel Try to change this configurations in your "fpc.cfg" file. Find that line: -Fu$LOCAL_APPDATA\FreePascal\fppkg/units/$FPCTARGET/* and replace to -Fu C:\lazarus\fpc\2.5.1\units\i386-win32\* regards Rafael Tuim -- ___ Lazarus mailing list Laz

Re: [Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread lazarusportugalwebmast...@gmail.com
No cross compiling. I got the Lazarus 0.9.31 SVN revision 31121 FPC 2.5.1 . -- # #lazarus-br em irc.freenode.org Lazarus, o pascal ainda tem futuro. # Comunidade portuguesa Lazarus, Delphi, Lazarus e Pascal. # IRC online

Re: [Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread Mattias Gaertner
    "lazarusportugalwebmast...@gmail.com" hat am 9. Juni 2011 um 18:29 geschrieben: > Hello. > I don't know wath I do at here but ever that I try compile any application on > Lazarus it gaves the error Fatal: Can't find unit ServiceManager used by > RegisterFCL, at the file C:\lazarus\packa

[Lazarus] Fatal: Can't find unit ServiceManager used by RegisterFCL

2011-06-09 Thread lazarusportugalwebmast...@gmail.com
Hello. I don't know wath I do at here but ever that I try compile any application on Lazarus it gaves the error Fatal: Can't find unit ServiceManager used by RegisterFCL, at the file C:\lazarus\packager\registration\fcllaz.pas(1,1) . How solve that? -- # #lazarus-br em irc.freenode.org Lazaru

Re: [Lazarus] Whats happend for snapshots?

2011-06-09 Thread Howard Page-Clark
On 09/6/11 3:57, lazarusportugalwebmast...@gmail.com wrote: Hi. I'm using Lazarus from snapshots because is more easy correct the bugs that Lazarus from SVN because WE NEED OF COMPILING IT AND IS HARD CORRECT THE BUGS OF SYNTAX of an IDE or compiler. So we want that snapshots existing and are upd

[Lazarus] Whats happend for snapshots?

2011-06-09 Thread lazarusportugalwebmast...@gmail.com
Hi. I'm using Lazarus from snapshots because is more easy correct the bugs that Lazarus from SVN because WE NEED OF COMPILING IT AND IS HARD CORRECT THE BUGS OF SYNTAX of an IDE or compiler. So we want that snapshots existing and are updated. When snapshot back? -- # #lazarus-br em irc.freenod

Re: [Lazarus] Little interface improvement (i think so...)

2011-06-09 Thread William Oliveira Ferreira
Thanks Flavio, i've joined... William de Oliveira Ferreira Bacharel em Sistemas de Informação Em 8 de junho de 2011 14:04, Flávio Etrusco escreveu: > There's a brazilian mailing list: > http://groups.google.com/group/lazarus-br > > > 2011/6/8 William Oliveira Fer

Re: [Lazarus] Little interface improvement (i think so...)

2011-06-09 Thread William Oliveira Ferreira
well i´ve read those links and i saw that with lazdockmangerdsn, it doesn't save window's size and positon. Someone faced this issue too? William de Oliveira Ferreira Bacharel em Sistemas de Informação 2011/6/8 William Oliveira Ferreira > Good, i'll read it late

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Flávio Etrusco
On Thu, Jun 9, 2011 at 9:29 AM, Henry Vermaak wrote: > On 09/06/11 13:04, Michael Schnell wrote: >> >>  On 06/09/2011 01:00 PM, Mattias Gaertner wrote: >>> >>> I made it thread safe. Please test. >>> >>> >> Thanks Mattias, you made my day ! >> >> Reading the other messages here, I actually conside

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Felipe Monteiro de Carvalho
On Thu, Jun 9, 2011 at 2:42 PM, Michael Schnell wrote: > I don't want to destroy something that somebody more knowledgeable created. This risk does not exist, patches are discussed and reviewed before being applyed. -- Felipe Monteiro de Carvalho --

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 02:29 PM, Henry Vermaak wrote: What pathetic attitude. You can fix these things yourself, but never do. I don't want to destroy something that somebody more knowledgeable created. It's always just talk with you, isn't it? Right now you are correct. (I do hope that my contributio

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 01:00 PM, Mattias Gaertner wrote: I made it thread safe. Please test. I verified that it works with my thread testing project (but I did not notice a problem before). Some thoughts: Did you verify that in a single worker thread situation the protection is necessary ? The worker

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 09/06/11 13:04, Michael Schnell wrote: On 06/09/2011 01:00 PM, Mattias Gaertner wrote: I made it thread safe. Please test. Thanks Mattias, you made my day ! Reading the other messages here, I actually considered unsubscribing from the list and forgetting about Lazarus altogether. Wha

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 09/06/11 12:55, Mattias Gaertner wrote: Henry Vermaak hat am 9. Juni 2011 um 13:28 geschrieben: >[...]> In TApplication.Destroy there is another call to ProcessAsyncCallQueue > further down (line 170). System.DoneCriticalSection(FAsyncCall.CritSec) > needs to be moved after it. Done.

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 01:00 PM, Mattias Gaertner wrote: I made it thread safe. Please test. Thanks Mattias, you made my day ! Reading the other messages here, I actually considered unsubscribing from the list and forgetting about Lazarus altogether. (A decent library needs to be usable ion a thre

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Mattias Gaertner
    Henry Vermaak hat am 9. Juni 2011 um 13:28 geschrieben: >[...]> In TApplication.Destroy there is another call to ProcessAsyncCallQueue > further down (line 170).  System.DoneCriticalSection(FAsyncCall.CritSec) > needs to be moved after it. Done. Mattias-- _

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Mattias Gaertner
    Graeme Geldenhuys hat am 9. Juni 2011 um 13:22 geschrieben: > On 09/06/2011 13:17, Mattias Gaertner wrote: > > > > Well, that is an "argument from ignorance". > > Then the documentation was written by the arrogant - expecting everybody > else to be mind readers.  I think you overstate

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 09/06/11 12:00, Mattias Gaertner wrote: Henry Vermaak hat am 9. Juni 2011 um 12:12 geschrieben: > On 09/06/11 11:01, Mattias Gaertner wrote: > > > > > > Michael Schnell hat am 9. Juni 2011 um 11:46 > > geschrieben: > > > > > On 06/09/2011 10:58 AM, Henry Vermaak wrote: > > > > You

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Graeme Geldenhuys
On 09/06/2011 13:17, Mattias Gaertner wrote: > > Well, that is an "argument from ignorance". Then the documentation was written by the arrogant - expecting everybody else to be mind readers. > The purpose is to execute a method outside the event where it was > initiated. For example to free a T

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 09/06/11 11:39, Michael Schnell wrote: On 06/09/2011 12:30 PM, Henry Vermaak wrote: Where do you find this "purpose". As Mattias said, the spec says nothing of the sort. I don't see any other purpose.;-) Bad eyesight? Henry -- ___ Lazarus maili

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Mattias Gaertner
    Michael Schnell hat am 9. Juni 2011 um 12:39 geschrieben: > On 06/09/2011 12:30 PM, Henry Vermaak wrote: > > Where do you find this "purpose".  As Mattias said, the spec says > > nothing of the sort. > I don't see any other purpose.;-)  Well, that is an "argument from ignorance".   The

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Mattias Gaertner
    Henry Vermaak hat am 9. Juni 2011 um 12:12 geschrieben: > On 09/06/11 11:01, Mattias Gaertner wrote: > > > > > > Michael Schnell hat am 9. Juni 2011 um 11:46 > > geschrieben: > > > >  > On 06/09/2011 10:58 AM, Henry Vermaak wrote: > >  > > You will corrupt the linked list that Queu

[Lazarus] [TIP]: Put border's in Your text

2011-06-09 Thread lazarusportugalwebmast...@gmail.com
Hi. Do you got the problem of put border's in your text? No stress. I solve the problem and put the solution on My blog at http://pprograming.blogspot.com/2011/06/text-with-borders-no-problem.html . So see my blog and no stress. -- # #lazarus-br em irc.freenode.org Lazarus, o pascal ainda tem fu

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 12:30 PM, Henry Vermaak wrote: Where do you find this "purpose". As Mattias said, the spec says nothing of the sort. I don't see any other purpose.;-) Protecting it in user code won't work, since the application can still remove calls while you try and add them. It needs to be p

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 12:10 PM, Henry Vermaak wrote: This will not even solve the problem, since the ProcessAsyncCallQueue and RemoveAsyncCalls also need to be protected. This is what I seem to have found, too. But it can't be done in user code which never calls RemoveAsyncCalls(). If it is really n

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 09/06/11 11:29, Michael Schnell wrote: On 06/09/2011 12:12 PM, Henry Vermaak wrote: Do you propose that QueueAsyncCall throws an exception if it's used from outside the main thread? The purpose of QueueAsyncCall() is to use it in worker threads to notify the main thread of something that ha

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 12:12 PM, Henry Vermaak wrote: Do you propose that QueueAsyncCall throws an exception if it's used from outside the main thread? The purpose of QueueAsyncCall() is to use it in worker threads to notify the main thread of something that happens in the thread (without the worker

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 09/06/11 11:01, Mattias Gaertner wrote: Michael Schnell hat am 9. Juni 2011 um 11:46 geschrieben: > On 06/09/2011 10:58 AM, Henry Vermaak wrote: > > You will corrupt the linked list that QueueAsyncCall() uses when you > > call it from multiple threads, so you _must_ protect it. > As Qu

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 08/06/11 16:39, Henry Vermaak wrote: On 08/06/11 16:28, Krzysztof wrote: Hm, I forgot about Application.QueueAsyncCall. And this can be safely call from thread without TThread.Synchronize() ? Because I don't want use Synchronize() in any part of thread code. So this is correct code? : proced

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 12:01 PM, Mattias Gaertner wrote: Why do you think it is thread safe? I just trusted that it would be properly designed. Looking at the code I found that it in fact seems to be buggy. The linked list is modified both by the (even single) Worker Thread when inserting an element

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Mattias Gaertner
    Michael Schnell hat am 9. Juni 2011 um 11:46 geschrieben: > On 06/09/2011 10:58 AM, Henry Vermaak wrote: > > You will corrupt the linked list that QueueAsyncCall() uses when you > > call it from multiple threads, so you _must_ protect it. > As QueueAsyncCall is specified exactly for thi

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 11:15 AM, Mattias Gaertner wrote: QueueAsyncCall is *not* thread safe. If this is ture, I would call it a bug, as QueueAsyncCall obviously is designed to be used by threads. but since we are talking about the GUI thread, latency is already so bad, that this makes no difference).

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/09/2011 10:58 AM, Henry Vermaak wrote: You will corrupt the linked list that QueueAsyncCall() uses when you call it from multiple threads, so you _must_ protect it. As QueueAsyncCall is specified exactly for this use, it needs to take care of this issue internally. Otherwise it obviously i

Re: [Lazarus] Illegal parameter: -WG

2011-06-09 Thread Mattias Gaertner
    Felipe Monteiro de Carvalho hat am 9. Juni 2011 um 10:52 geschrieben: > On Wed, Jun 8, 2011 at 7:48 PM, Florian Klaempfl > wrote: > > Maybe it's worse to check all the -W switches in lazarus. I made them > > all target dependent. > > The problem that I see here will be with build scr

Re: [Lazarus] Dynamic loading of a custom sqlite library

2011-06-09 Thread Max Vlasov
On Wed, Jun 8, 2011 at 6:27 PM, Max Vlasov wrote: > Hi, > > I encountered problems using dynamically loaded sqlite library with lazarus > on linux. > My post about this in the sqlite list is here: > http://www.mail-archive.com/sqlite-users@sqlite.org/msg61565.html > Maybe someone points me to the

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Mattias Gaertner
    Michael Schnell hat am 9. Juni 2011 um 10:50 geschrieben: > On 06/08/2011 05:39 PM, Henry Vermaak wrote: > >> There is no chance for deadlock with main thread calling this from > >> inside another thread? > > > > > > You have to protect it with a critical section (if you have more tha

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Henry Vermaak
On 09/06/11 09:50, Michael Schnell wrote: On 06/08/2011 05:39 PM, Henry Vermaak wrote: There is no chance for deadlock with main thread calling this from inside another thread? You have to protect it with a critical section (if you have more than one thread calling QueueAsyncCall). A critic

Re: [Lazarus] Illegal parameter: -WG

2011-06-09 Thread Felipe Monteiro de Carvalho
On Wed, Jun 8, 2011 at 7:48 PM, Florian Klaempfl wrote: > Maybe it's worse to check all the -W switches in lazarus. I made them > all target dependent. The problem that I see here will be with build script. Let's say you have a script to build your GUI program. Until now you could simply pass all

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/08/2011 06:48 PM, Krzysztof wrote: 1. Thread add queue calling Application.QueueAsyncCall(MyObj.EventMethod, 0); Why does it not create a data storage and provides the pointer ? 2. MyObj is destroyed by main thread How does the Main thread know about it ? 3. Main thread process message

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/08/2011 05:39 PM, Henry Vermaak wrote: There is no chance for deadlock with main thread calling this from inside another thread? You have to protect it with a critical section (if you have more than one thread calling QueueAsyncCall). A critical section likely will kill the thread lat

Re: [Lazarus] How to PostMessage to object?

2011-06-09 Thread Michael Schnell
On 06/08/2011 05:28 PM, Krzysztof wrote: Hm, I forgot about Application.QueueAsyncCall. And this can be safely call from thread without TThread.Synchronize() ? This is exactly what Application.QueueAsyncCall() (and what the Delphi-Worlkalike TThread.Queue() ) does- Because I don't want use Sync