CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2011
    Posts
    5

    pass parameter to running thread

    I have a c# program once when one of the button pressed , a parameter can pass to running thread, as

    public void TransfersThread(object data1)
    {
    .....
    bRunning = true;
    for (; bRunning && bResult; )
    {
    outData[0] = Convert.ToByte(data1);
    ......
    }
    }

    How can I write a program as to pass parameter to this continous running thread ???

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: pass parameter to running thread

    Search bing or google for "thread C#". In the search results look for the many hits that contain the word "tutorial".

  3. #3
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: pass parameter to running thread

    Passing a parameter souds like calling a method, co call a method on instace common to both threads.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured