detach thread in c?

Discussion in 'C Programming' started by joe, Jan 9, 2004.

  1. joe

    joe Guest

    Hi i just converted a console app to a function, the code has a statement
    freeconsole() and after that the function does not work. If I take
    freeconsole out then i dont get out of the loop. Is there a way to launch
    the procedure in a separete console. so i can keep using my console. or put
    it in another thread. I am looking around now and the only thing that i can
    think of is CreateProcess, the function looks like this int
    oldmain(parametes);
    how can i launch it in a separete thread or console. thanks..

    when i use
    handle = (HANDLE) _beginthread(myfuction(),0,NULL(;
    and
    WaitForSingleObject(handle,INFINITE);

    i dont get past begin thread and my program halts after that line
     
    joe, Jan 9, 2004
    #1
    1. Advertisements

  2. joe <> wrote in
    news:Xns946B738349013josephthecianet@207.69.154.205:

    > when i use
    > handle = (HANDLE) _beginthread(myfuction(),0,NULL(;


    This is not C. Try a newsgroup that discusses threads.

    --
    - Mark ->
    --
     
    Mark A. Odell, Jan 9, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timo Nentwig
    Replies:
    0
    Views:
    1,015
    Timo Nentwig
    Feb 4, 2004
  2. Dmitry Teslenko
    Replies:
    2
    Views:
    405
    Dmitry Teslenko
    Nov 9, 2007
  3. Tamer Ibrahim

    Attach and Detach SQL Express Database

    Tamer Ibrahim, Jul 3, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    617
    Tamer Ibrahim
    Jul 3, 2008
  4. Tamer Ibrahim

    Attach and Detach

    Tamer Ibrahim, Jul 3, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    453
    Tamer Ibrahim
    Jul 3, 2008
  5. Fan Kai
    Replies:
    0
    Views:
    583
    Fan Kai
    Dec 30, 2008
  6. AAaron123

    My code appears to fail to detach the DB

    AAaron123, Apr 8, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    460
    AAaron123
    Apr 8, 2009
  7. Evan Webb
    Replies:
    0
    Views:
    168
    Evan Webb
    Jan 13, 2004
  8. Joe Van Dyk

    speeding up Process.detach frequency

    Joe Van Dyk, Jun 25, 2005, in forum: Ruby
    Replies:
    7
    Views:
    213
Loading...