Closed Thread
Results 1 to 3 of 3

Thread: Creating a Thread

  1. #1
    Lop's Avatar
    Lop
    Lop is offline Speaks fluent binary
    Join Date
    May 2006
    Posts
    1,178
    Rep Power
    30

    Creating a Thread

    I am working on a project and need to know how to create a thread in Managed C++ using VS 2005. I have tutorials but none of them work (from google and MSDN). Can anyone show me the correct code?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Lop's Avatar
    Lop
    Lop is offline Speaks fluent binary
    Join Date
    May 2006
    Posts
    1,178
    Rep Power
    30
    Anyone?

  4. #3
    smith is offline Programmer
    Join Date
    Jun 2006
    Posts
    153
    Rep Power
    0
    Declare this globally (or local but you'll have no control over it)

    Code:
    private: Threading::Thread^ myThread;
    Then execute your thread like
    Code:
    Threading::ThreadStart^ threadStart = 
    gcnew Threading::ThreadStart(this,&yourClass::Form1::Function);
    myThread = gcnew Threading::Thread(threadStart);
    myThread->Start();
    you need to change what I have bolded above (yourClass,Form1 and Function) to match your program.
    Code:
    for (int i;;) {
       cout << "Smith";
    }

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. boost thread slow with only one thread
    By Chatte in forum C and C++
    Replies: 1
    Last Post: 05-20-2010, 10:59 AM
  2. Another asking for help thread.
    By Moudi in forum C and C++
    Replies: 8
    Last Post: 04-05-2010, 01:44 AM
  3. New! - What I Look Like Thread.
    By Donovan in forum The Lounge
    Replies: 30
    Last Post: 05-30-2009, 07:26 AM
  4. Creating some sort of Thread listener
    By ThemePark in forum Java Help
    Replies: 0
    Last Post: 01-13-2009, 11:47 AM
  5. The what does your room look like thread (WDYRLL Thread)
    By morefood2001 in forum The Lounge
    Replies: 22
    Last Post: 09-27-2008, 07:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts