FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Timers and loops
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Timers and loops
Posted: Tue Feb 09, 2010 05:51 PM
These posts from Przemek are advisable to be read before start using MT code:
http://www.matrixlist.com/pipermail/harbour/2009-November/026773.html

Very important warning about how to deal with Windows messages:
http://www.matrixlist.com/pipermail/harbour/2009-November/026781.html
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Timers and loops
Posted: Wed Feb 10, 2010 04:54 AM
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=download/windows/binaries_win. Unfortunately the downloaded xHarbour zip too does not contain the said crtmt.lib

Regards
Anser
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Timers and loops
Posted: Wed Feb 10, 2010 07:51 AM

No crtmt.lib exists in the xHarbour CVS.

EMG

Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Timers and loops
Posted: Wed Feb 10, 2010 08:06 AM
Dear Mr.EMG,

crtmt.lib exists in the xHarbour CVS


Thank you. Now I have to start learning about using CVS :-)

Anser
Posts: 90
Joined: Wed Nov 07, 2007 08:56 AM
Re: Timers and loops
Posted: Wed Feb 10, 2010 08:14 AM

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:

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Timers and loops
Posted: Wed Feb 10, 2010 08:32 AM
anserkk wrote:Dear Mr.EMG,

crtmt.lib exists in the xHarbour CVS


Thank you. Now I have to start learning about using CVS :-)

Anser


Please reread my message: "No crtmt.lib exists..."

EMG
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Timers and loops
Posted: Wed Feb 10, 2010 09:19 AM

Thank you both Mr.EMG and Mr.Patrizio

Regards
Anser

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Timers and loops
Posted: Wed Feb 10, 2010 12:33 PM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Timers and loops
Posted: Thu Feb 11, 2010 06:56 AM
Dear Mr.Antonio,

Anyhow, with xHarbour and Borland it crashes

You are right.

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Timers and loops
Posted: Thu Feb 11, 2010 09:17 AM

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 :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Timers and loops
Posted: Thu Feb 11, 2010 09:54 AM
Dear Mr.Antonio,

Thank you. You are right.
GetThreadID() is giving error but GetSystemThreadID() is working fine

Code (fw): Select all Collapse
oDlg:Say(n,0,"system id: " + lTrim(Str(GetSystemThreadID())))


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
Posts: 2
Joined: Mon Mar 02, 2009 10:15 AM
Re: Timers and loops
Posted: Tue Feb 16, 2010 12:53 PM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Timers and loops
Posted: Tue Feb 16, 2010 01:14 PM

Erwin,

Are you creating and using the dialog from the same thread ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2
Joined: Mon Mar 02, 2009 10:15 AM
Re: Timers and loops
Posted: Wed Feb 17, 2010 07:48 AM
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.




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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Timers and loops
Posted: Wed Feb 17, 2010 08:35 AM
Erwin,

Have you loaded the richedit DLL ?
Code (fw): Select all Collapse
   local hDLL := LoadLibrary( "Riched20.dll" )

In case you did, please try to load it in the same thread where you try to build the dialog
regards, saludos

Antonio Linares
www.fivetechsoft.com