passing data to a form in another thread

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.

Thanks,
Christian

Comments

  • 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.

Howdy, Stranger!

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

Categories

In this Discussion