Re: [lazarus] A Thread in DLL

2007-12-17 Thread melchiorre caruso
Al Boldi wrote: I do not know how to do it, It turns out that you need an export trick to do this. Include the attached 'LibSyncMgr.inc' into your lib after your exports-line with this line: {$i LibSyncMgr.inc} Make sure there is no LCL or Interfaces unit included in your

Re: [lazarus] A Thread in DLL

2007-12-17 Thread Al Boldi
melchiorre caruso wrote: Al Boldi wrote: I do not know how to do it, It turns out that you need an export trick to do this. Include the attached 'LibSyncMgr.inc' into your lib after your exports-line with this line: {$i LibSyncMgr.inc} Make sure there is no LCL or

Re: [lazarus] A Thread in DLL

2007-12-15 Thread Michael Van Canneyt
On Sat, 15 Dec 2007, Al Boldi wrote: melchiorre caruso wrote: I found an article that explains why my code does not work on Windows: Actually, I had a closer look at synchronize, and it turns out to be dependent on the GUI, which probably means that you need to include 'Interfaces' in

Re: [lazarus] A Thread in DLL

2007-12-15 Thread Al Boldi
Michael Van Canneyt wrote: On Sat, 15 Dec 2007, Al Boldi wrote: melchiorre caruso wrote: I found an article that explains why my code does not work on Windows: Actually, I had a closer look at synchronize, and it turns out to be dependent on the GUI, which probably means that you need

Re: [lazarus] A Thread in DLL

2007-12-15 Thread Vincent Snijders
Al Boldi schreef: Michael Van Canneyt wrote: On Sat, 15 Dec 2007, Al Boldi wrote: melchiorre caruso wrote: I found an article that explains why my code does not work on Windows: Actually, I had a closer look at synchronize, and it turns out to be dependent on the GUI, which probably means

Re: [lazarus] A Thread in DLL

2007-12-15 Thread melchiorre caruso
Al Boldi wrote: Michael Van Canneyt wrote: On Sat, 15 Dec 2007, Al Boldi wrote: melchiorre caruso wrote: I found an article that explains why my code does not work on Windows: Actually, I had a closer look at synchronize, and it turns out to be dependent on the GUI,

Re: [lazarus] A Thread in DLL

2007-12-15 Thread Al Boldi
Vincent Snijders wrote: Al Boldi schreef: Vincent Snijders wrote: WakeMainThread is just one way to make sure that the calling thread calls CheckSynchronize from time to time. Synchronize does not depend on how the main thread call CheckSynchronize, just that it is accomplished.

Re: [lazarus] A Thread in DLL

2007-12-14 Thread melchiorre caruso
I found an article that explains why my code does not work on Windows: http://www.clevercomponents.com/articles/article019/delphi6sync.asp Now it works. unit threadx; interface uses Windows, Classes; type TThreadSynchronizer = class private FMethod: TThreadMethod;

Re: [lazarus] A Thread in DLL

2007-12-14 Thread Al Boldi
melchiorre caruso wrote: I found an article that explains why my code does not work on Windows: Actually, I had a closer look at synchronize, and it turns out to be dependent on the GUI, which probably means that you need to include 'Interfaces' in your library uses clause. Can you try this

Re: [lazarus] A Thread in DLL

2007-12-09 Thread Al Boldi
melchiorre caruso wrote: Al Boldi wrote: melchiorre caruso wrote: if I use in execute method the source if Assigned (FMethod) then FMethod; instead of if Assigned (FMethod) then Synchronize(FMethod); the method fMethod is called but not synchronized. Then the

Re: [lazarus] A Thread in DLL

2007-12-09 Thread Al Boldi
melchiorre caruso wrote: Al Boldi wrote: So it's either an fpc or windows issue. Can you statically link it on windows, and see if it make a difference? I have statically linked library to application with this results Library.MainBlock MainThreadID = 3496 Library.MainBlock

Re: [lazarus] A Thread in DLL

2007-12-09 Thread melchiorre caruso
Al Boldi wrote: melchiorre caruso wrote: Al Boldi wrote: So it's either an fpc or windows issue. Can you statically link it on windows, and see if it make a difference? I have statically linked library to application with this results Library.MainBlock MainThreadID = 3496

Re: [lazarus] A Thread in DLL

2007-12-09 Thread melchiorre caruso
Al Boldi wrote: melchiorre caruso wrote: Al Boldi wrote: So it's either an fpc or windows issue. Can you statically link it on windows, and see if it make a difference? I have statically linked library to application with this results Library.MainBlock MainThreadID = 3496

Re: [lazarus] A Thread in DLL

2007-12-09 Thread Al Boldi
melchiorre caruso wrote: Can You send to me the source that runs correctly on linux? I am using your source. Thanks! -- Al _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives

Re: [lazarus] A Thread in DLL

2007-12-08 Thread Al Boldi
melchiorre caruso wrote: Al Boldi wrote: melchiorre caruso wrote: procedure TTestLibrary.TestBtnClick(Sender: TObject); nbsp; LibHandle := LoadLibrary('thread2lib.dll'); CreateMyThreadFunc := GetProcedureAddress(LibHandle,'CreateMyThread'); Make sure your library actually loads...

Re: [lazarus] A Thread in DLL

2007-12-07 Thread melchiorre caruso
Al Boldi wrote: melchiorre caruso wrote: procedure TTestLibrary.TestBtnClick(Sender: TObject); nbsp; LibHandle := LoadLibrary('thread2lib.dll'); CreateMyThreadFunc := GetProcedureAddress(LibHandle,'CreateMyThread'); Make sure your library actually loads... if I use in execute

Re: [lazarus] A Thread in DLL

2007-12-07 Thread Al Boldi
melchiorre caruso wrote: procedure TTestLibrary.TestBtnClick(Sender: TObject);br beginbr nbsp; LibHandle := LoadLibrary('thread2lib.dll');br nbsp; CreateMyThreadFunc := GetProcedureAddress(LibHandle, 'CreateMyThread');br Make sure your library actually loads... nbsp; if

Re: [lazarus] A Thread in DLL

2007-12-07 Thread Al Boldi
melchiorre caruso wrote: !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN Can you post text only messages? ttI try to use CheckSyncronize() in the application loop but without result;br The function synchronize appears to be broken and, br the event on-terninate not be called. I

Re: [lazarus] A Thread in DLL

2007-12-07 Thread melchiorre caruso
Graeme Geldenhuys wrote: On 06/12/2007, melchiorre caruso [EMAIL PROTECTED] wrote: Hi everybody, I have a question about to Thread and DLL library. Is it possible to create a function that has as result a thread, and insert it into a dll? The issue is probably cause by the same

[lazarus] A Thread in DLL

2007-12-06 Thread melchiorre caruso
Hi everybody, I have a question about to Thread and DLL library. Is it possible to create a function that has as result a thread, and insert it into a dll? example: library getthread ... function CreateMyThread: TThread; begin Result := TMyThread.Create; end; ... exports CreateMyThread

Re: [lazarus] A Thread in DLL

2007-12-06 Thread Graeme Geldenhuys
On 06/12/2007, melchiorre caruso [EMAIL PROTECTED] wrote: Hi everybody, I have a question about to Thread and DLL library. Is it possible to create a function that has as result a thread, and insert it into a dll? The issue is probably cause by the same problem I had with threads in console