Developers' Area
| |
Not signed in (Sign In)

Vanilla 1.1.2 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthoraudinue
    • CommentTimeMay 18th 2008
     
    I think,...

    It's impossible to compile applications using Ecere without runtime (ecere.dll in Windows)...

    Am I wrong?
    •  
      CommentAuthorjerome
    • CommentTimeMay 18th 2008 edited
     
    Hi audinue,

    It is possible to compile eC applications with only ecereCOM.dll.
    You go in Project Settings, and change "ecere" to "ecereCOM".

    And of course you don't import "ecere'.
    This will only allow to use the eC language and the core functionality, but not the GUI toolkit etc.

    And of you still need ecere.dll to run the IDE and the compiling tools during the compilation process, but your compiled application will not require it to run.
    • CommentAuthoraudinue
    • CommentTimeMay 18th 2008
     
    I LOVE You, Jerome!
    •  
      CommentAuthorjerome
    • CommentTimeMay 19th 2008 edited
     
    audinue, the following will produce a predictable result counting a from 1 to 20. Maybe you missed the instantiation brackets after your mutex declaration ? Or maybe you used a different mutex for each thread?
    Also note that you have to initialize a to 1 to get it all the way to 20.
    And note that it's better to put t1 and t2 inside the App class (or outside in the global scope), so that they will automatically be reference incremented and deleted (otherwise it can be done using the incref and delete keywords). We need to own a reference to it if we want to Wait for the threads.


    import "ecere"

    Mutex mutex {};
    T t1 {};
    T t2 {};
    int a;

    class App : Application
    {
    void Main()
    {
    a = 1;
    t1.Create();
    t2.Create();
    t1.Wait();
    t2.Wait();
    getch();
    }
    }
    class T : Thread
    {
    unsigned int Main()
    {
    int i;
    for(i=0; i<10; i++)
    {
    mutex.Wait();
    printf("%d\n", a);
    a++;
    mutex.Release();
    }
    return 0;
    }
    }
    • CommentAuthoraudinue
    • CommentTimeMay 21st 2008
     
    Sorry about bad inet connection...

    Btw, I'll make a documentation about Ecere and post them soon...

    Only one I need is consitency (both in syntax and library(classes))...
    That's very important for a programming language I guess...

    Thank's for your support!