Page 7 of 8
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 5:23 pm
by Richard Chidiak
Antonio,
My pleasure , i would be glad to help
I will publish a copy of my codejock program running (same program) with Xharbour and Harbour
Massimo : Sorry about the link, we had a hack on our servers 3 months ago and we had to reinstall almost everything, this sample was not backed.
I can provide any help on Codejock if you need, just let me know.
Just to mention, i have moved all my applications from xharbour/bcc 5.82 to Harbour/MSVC 2010.
Regards,
Richard
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 5:37 pm
by Massimo Linossi
Thanks Richard, very kind.
No problem with the link, I've made some tests with the one that Antonio has published.
The problem is that I receive some errors when I try to run it. And if I correct one line there is another one
that is generating another error. And so on. So I think that the problem is not the code but the compiler,
because if you have published that code, it was working. For these reasons I want to change the compiler and
to pass to Harbour, and to test also MSVC.
When I'm ready to make the transition, If I can ask something to you it will be a great help.
Thanks a lot.
Massimo
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 6:08 pm
by TimStone
Massimo and Richard,
I am also working with Codejock. I originally had it running perfectly with xHarbour ( .com ), but I've been transition my primary application to Harbour / MSVC 2010.
I have further testing to do with some of my other ActiveX controls, but so far it looks like everything is running well. I don't do major updates for my clients over the summer ( only smaller modifications automatically updated ). However, my goal is to release for general use the MSVC version in September.
I would strongly encourage people to make this shift. Ultimately I think we will see more potential for integration. Yes, we are likely to also do the shift to 2012 Visual Studio with Harbour / FWH. There is great potential there.
Richard, you can also share my calendar program because I believe it is an easier implementation. Just remove the license key .... but I think you already have it without that.
Tim
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 6:13 pm
by Enrico Maria Giordano
Antonio Linares wrote:Enrico,
Could you provide a small self contained example ? thanks
Here it is:
Code: Select all | Expand
FUNCTION MAIN()
LOCAL hBkg := HB_BACKGROUNDADD( { || Tone( 440, 1 ) }, 10, .F. )
LOCAL hIdl := HB_IDLEADD( { || HB_BackGroundRun( hBkg ) } )
SET BACKGROUND TASKS ON
HB_BACKGROUNDACTIVE( hBkg, .T. )
INKEY( 0 )
SET BACKGROUND TASKS OFF
HB_BACKGROUNDDEL( hBkg )
HB_IDLEDEL( hIdl )
RETURN NIL
EMG
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 7:37 pm
by Antonio Linares
Enrico,
Here you can review Harbour threads management great examples:
https://github.com/harbour/core/tree/master/tests/mtSurely there are some that are very similar. I wonder if xharbour supports them.
I think that we could implement the function HB_BACKGROUNDADD() using Harbour functions...
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 7:47 pm
by Enrico Maria Giordano
What if I don't want to use multithreading libs (they would inflate my EXEs, I suppose)?
EMG
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 7:52 pm
by lucasdebeltran
Mr. Enrico,
Why are you afraid with exe sizes with present Ram sizes of the Pcs?.
Also, I indicated you some swithcs for latest BCC to reduce size. Are you happy with them?.
Thank you.
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 7:53 pm
by Antonio Linares
Enrico,
Here you have a Harbour example similar to yours:
Code: Select all | Expand
#include "FiveWin.ch"
function Main()
local thID := hb_threadStart( @thFunc() )
MsgInfo( "ok" )
return nil
function thFunc()
local n
for n = 1 to 10
Tone( 440, 1 )
next
return nil
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 7:55 pm
by Antonio Linares
Using a codeblock:
Code: Select all | Expand
#include "FiveWin.ch"
static bAction
function Main()
local thId
bAction = { || Tone( 440, 1 ) }
thId = hb_threadStart( @thFunc() )
MsgInfo( "ok" )
return nil
function thFunc()
local n
for n = 1 to 10
Eval( bAction )
next
return nil
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 7:56 pm
by Antonio Linares
In order to build those examples hbvmmt.lib has to be linked instead of hbvm.lib
and also from Borland, we have to link cw32mt.lib instead of cw32.lib
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 8:00 pm
by Antonio Linares
Enrico,
My example size built using threads is 2.515.416 bytes
without threads: 2.486.784 bytes
very little difference
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 8:01 pm
by Antonio Linares
Enrico,
Keep in mind that if you are not using threads then you are slicing the Harbour virtual machine execution process and slowing the whole app.
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 8:06 pm
by Antonio Linares
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 10:25 pm
by Enrico Maria Giordano
Thank you Master. I'll try it.
EMG
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 10:48 pm
by Enrico Maria Giordano
Sorry, the background task is only one of the incompatibilities I found. The warnings is another one (see an old thread on this subject).
EMG