passing data to a form in another thread - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

passing data to a form in another thread

CWittrockCWittrock Posts: 1Member
I am a "lucky" guy. My boss has told me to program in C++ in .NET.

I need to do this:

1. When I click on a button in my windows form, a separate managed thread must be created. This I have done and it works fine.
2. The new thread shall communicate with external devices over a CAN bus. Data received on the CAN bus must be passed back to windows form thread, so that it can be displayed in a textbox. This is what causes me problems.

Can anyone help me with a simple example of how to make a callback from a managed C++ thread to a managed C++ windows form thread?

any help will be much appreciated.



  • SpaceMan1234SpaceMan1234 Posts: 5Member
    Hello Christian

    use backgroundworker for the child thread you are using to read the CAN. also enable its reportsprogress feature. the reports progress feature has 2 overloads, one is for percentage and another is for percentage and user defined value.

    are you using vector can for your application?

Sign In or Register to comment.