Timers and loops
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Timers and loops
These posts from Przemek are advisable to be read before start using MT code:
http://www.matrixlist.com/pipermail/har ... 26773.html
Very important warning about how to deal with Windows messages:
http://www.matrixlist.com/pipermail/har ... 26781.html
http://www.matrixlist.com/pipermail/har ... 26773.html
Very important warning about how to deal with Windows messages:
http://www.matrixlist.com/pipermail/har ... 26781.html
Re: Timers and loops
Mr.Antonio,
Thank you for the information.
Mr.Patrizio,
I have ctmt.lib, but no crtmt.lib in my xHarbour libs folder (Supplied along with FWH 9.08). Linking ctmt.lib did not solve the problem. I tried to download xHarbour binaries for Borland C++ 5.5.1 from http://www.xharbour.org/index.asp?page= ... naries_win. Unfortunately the downloaded xHarbour zip too does not contain the said crtmt.lib
Regards
Anser
Thank you for the information.
Mr.Patrizio,
I have ctmt.lib, but no crtmt.lib in my xHarbour libs folder (Supplied along with FWH 9.08). Linking ctmt.lib did not solve the problem. I tried to download xHarbour binaries for Borland C++ 5.5.1 from http://www.xharbour.org/index.asp?page= ... naries_win. Unfortunately the downloaded xHarbour zip too does not contain the said crtmt.lib
Regards
Anser
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Timers and loops
No crtmt.lib exists in the xHarbour CVS.
EMG
EMG
Re: Timers and loops
Dear Mr.EMG,
Anser
Thank you. Now I have to start learning about using CVScrtmt.lib exists in the xHarbour CVS
![Smile :)](./images/smilies/icon_smile.gif)
Anser
Re: Timers and loops
Anserkk, sorry i use xHarbour commercial.
Try to link vmmt.lib.
If you download Explorer Lib http://codigo-base.blogspot.com/search/ ... orer%20Lib you can see all the function provide by a lib and seek the lib to link for undefined function like this![Wink :wink:](./images/smilies/icon_wink.gif)
Try to link vmmt.lib.
If you download Explorer Lib http://codigo-base.blogspot.com/search/ ... orer%20Lib you can see all the function provide by a lib and seek the lib to link for undefined function like this
![Wink :wink:](./images/smilies/icon_wink.gif)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Timers and loops
Please reread my message: "No crtmt.lib exists..."anserkk wrote:Dear Mr.EMG,
Thank you. Now I have to start learning about using CVScrtmt.lib exists in the xHarbour CVS![]()
Anser
EMG
Re: Timers and loops
Thank you both Mr.EMG and Mr.Patrizio
Regards
Anser
Regards
Anser
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Timers and loops
Anser,
To build it using xHarbour and Borland, these libraries are required:
From xharbour:
rtlmt.lib instead of rtl.lib
vmmt.lib instad of vm.lib
From Borland:
cw32mt.lib instead of cw32.lib
Anyhow, with xHarbour and Borland it crashes
To build it using xHarbour and Borland, these libraries are required:
From xharbour:
rtlmt.lib instead of rtl.lib
vmmt.lib instad of vm.lib
From Borland:
cw32mt.lib instead of cw32.lib
Anyhow, with xHarbour and Borland it crashes
Re: Timers and loops
Dear Mr.Antonio,
What about with Harbour ?.
To do a MultiThread test using Harbour, In the BuildH.Bat, I replaced the lib HbVm with HbVmMt, but the replacement lib for HbRtl, HbRtlMt does not exist in my lib folder
Regards
Anser
You are right.Anyhow, with xHarbour and Borland it crashes
What about with Harbour ?.
To do a MultiThread test using Harbour, In the BuildH.Bat, I replaced the lib HbVm with HbVmMt, but the replacement lib for HbRtl, HbRtlMt does not exist in my lib folder
Regards
Anser
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Timers and loops
Anser,
With Harbour it worked fine with these libraries (and a little change in the example source code):
From Harbour:
hbvmmt.lib instead of hbvm.lib
adding xhb.lib (to have xHarbour compatibility on threads)
From Borland:
cw32mt.lib instead of cw32.lib
And I modified this line this way:
oDlg:Say(n,0, Str( n ) ) // "Thread ID" + lTrim(Str(GetThreadID())) + " system id: " + lTrim(Str(GetSystemThreadID())))
It seems to work fine![Smile :-)](./images/smilies/icon_smile.gif)
With Harbour it worked fine with these libraries (and a little change in the example source code):
From Harbour:
hbvmmt.lib instead of hbvm.lib
adding xhb.lib (to have xHarbour compatibility on threads)
From Borland:
cw32mt.lib instead of cw32.lib
And I modified this line this way:
oDlg:Say(n,0, Str( n ) ) // "Thread ID" + lTrim(Str(GetThreadID())) + " system id: " + lTrim(Str(GetSystemThreadID())))
It seems to work fine
![Smile :-)](./images/smilies/icon_smile.gif)
Re: Timers and loops
Dear Mr.Antonio,
Thank you. You are right.
GetThreadID() is giving error but GetSystemThreadID() is working fine
So I understand that as of now, for Multi threads projects using xHarbour & Borland is not a good choice.
I would like to know whether any body here is using Multi thread technology in their existing apps using Harbour and Borland
Regards
Anser
Thank you. You are right.
GetThreadID() is giving error but GetSystemThreadID() is working fine
Code: Select all
oDlg:Say(n,0,"system id: " + lTrim(Str(GetSystemThreadID())))
![Sad :(](./images/smilies/icon_sad.gif)
I would like to know whether any body here is using Multi thread technology in their existing apps using Harbour and Borland
Regards
Anser
Re: Timers and loops
Antonio Linares wrote:Patrizio,
Have you tried to use mt with FiveWin ?
mt should work fine except for some GUI components (modal dialog boxes)
Hello.
I'm trying to get MT working with FiveWin for Xharbour.
When a try to avoid using modal dialogs, I probably need to enable dispatching events from the queue using SysWait otherwise the dialog/window just freezes. When I call Syswait in a secondary thread (in which the dialog was created), I see that the events are dipatches ok but I see a GPF now and then.
Probably this problem is related to the Windows messaging / MT discussions posted previously.
Is there another way to overcome this?
Regards,
Erwin
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Timers and loops
Erwin,
Are you creating and using the dialog from the same thread ?
Are you creating and using the dialog from the same thread ?
Re: Timers and loops
Hello Antonio,
I develop an MDI application that checks for messages on the internet as a background thread. When a message is received, it is displayed in an MDI window.
When I try to display the richtech message in a dialog, I experience a Fivewin : Cannot create Dialog box error. This is why I create a new MDI window to show the RTF message. I have made a sketch to explain this. consider Thread 0 the main thread and thread 1 the first spawned thread. Thread 1.1 was spawned from thread 1.
![Image](http://www.mijnbroerinafrika.nl/threads.png)
Currently thread 1 opens a modal dialog asking the user whether or not to show the message. Hereafter, the thread 1.1 is spawned.
Regards,
Erwin
I develop an MDI application that checks for messages on the internet as a background thread. When a message is received, it is displayed in an MDI window.
When I try to display the richtech message in a dialog, I experience a Fivewin : Cannot create Dialog box error. This is why I create a new MDI window to show the RTF message. I have made a sketch to explain this. consider Thread 0 the main thread and thread 1 the first spawned thread. Thread 1.1 was spawned from thread 1.
![Image](http://www.mijnbroerinafrika.nl/threads.png)
Currently thread 1 opens a modal dialog asking the user whether or not to show the message. Hereafter, the thread 1.1 is spawned.
Regards,
Erwin
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Timers and loops
Erwin,
Have you loaded the richedit DLL ?
In case you did, please try to load it in the same thread where you try to build the dialog
Have you loaded the richedit DLL ?
Code: Select all
local hDLL := LoadLibrary( "Riched20.dll" )