FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Codejock Calendar Samples?
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 05:23 PM

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

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 05:37 PM

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

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 06:08 PM

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

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 06:13 PM
Antonio Linares wrote:Enrico,

Could you provide a small self contained example ? thanks :-)


Here it is:

Code (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 07:37 PM
Enrico,

Here you can review Harbour threads management great examples:

https://github.com/harbour/core/tree/master/tests/mt

Surely 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...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 07:47 PM

What if I don't want to use multithreading libs (they would inflate my EXEs, I suppose)?

EMG

Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 07:52 PM

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.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 07:53 PM
Enrico,

Here you have a Harbour example similar to yours:

Code (fw): Select all Collapse
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 07:55 PM
Using a codeblock:

Code (fw): Select all Collapse
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 07:56 PM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 08:00 PM

Enrico,

My example size built using threads is 2.515.416 bytes

without threads: 2.486.784 bytes

very little difference :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 08:01 PM

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.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 08:06 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 10:25 PM

Thank you Master. I'll try it.

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Codejock Calendar Samples?
Posted: Sat May 25, 2013 10:48 PM

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