Timers and loops

Re: Timers and loops

Postby Antonio Linares » Tue Feb 09, 2010 5: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Timers and loops

Postby anserkk » Wed Feb 10, 2010 4: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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Timers and loops

Postby Enrico Maria Giordano » Wed Feb 10, 2010 7:51 am

No crtmt.lib exists in the xHarbour CVS.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Timers and loops

Postby anserkk » Wed Feb 10, 2010 8:06 am

Dear Mr.EMG,

crtmt.lib exists in the xHarbour CVS


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

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Timers and loops

Postby Patrizio » Wed Feb 10, 2010 8: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:
Patrizio
 
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy

Re: Timers and loops

Postby Enrico Maria Giordano » Wed Feb 10, 2010 8: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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Timers and loops

Postby anserkk » Wed Feb 10, 2010 9:19 am

Thank you both Mr.EMG and Mr.Patrizio

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Timers and loops

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Timers and loops

Postby anserkk » Thu Feb 11, 2010 6: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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Timers and loops

Postby Antonio Linares » Thu Feb 11, 2010 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Timers and loops

Postby anserkk » Thu Feb 11, 2010 9:54 am

Dear Mr.Antonio,

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

Code: Select all  Expand view
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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Timers and loops

Postby erwinn » 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
erwinn
 
Posts: 2
Joined: Mon Mar 02, 2009 10:15 am

Re: Timers and loops

Postby Antonio Linares » Tue Feb 16, 2010 1:14 pm

Erwin,

Are you creating and using the dialog from the same thread ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Timers and loops

Postby erwinn » Wed Feb 17, 2010 7: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.


Image

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
erwinn
 
Posts: 2
Joined: Mon Mar 02, 2009 10:15 am

Re: Timers and loops

Postby Antonio Linares » Wed Feb 17, 2010 8:35 am

Erwin,

Have you loaded the richedit DLL ?
Code: Select all  Expand view

   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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 65 guests