Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Does the WaveFormGraph accept multithreading in c#

Hello,
I m working on visual studio 2005 (in C#) and use WaveFormGraph component 8.5. My application is a MDI interface and each child window content a waveformgraph component. The problem appears when i create a child window, which embeded the component, from an external thread. I use delegates functions as it's explained by Microsoft, but it doesn't work fine. The error message says that the controls created on a thread can not be parents of a control of another thread (see the attached file).
Sometimes the child window is created correctly and sometime it is not. Is the WaveformGraph component thread safe ?

The line which cause the problem is :
                        try
                        {
                            myPhysGraphViewer.MdiParent = this;
                        }
                        catch(Exception Exc)
                        {
                                ...
                        }

where :
 - 'this' is the instance of the main class
 - 'myPhysGraphViewer'  is the child window which contains the waveformgraph component

Could you help me please ?
Best regards
Norbert

0 Kudos
Message 1 of 2
(3,518 Views)
Hello,
 
For each thread you can associate an interface with somes components.
Your problem it's that you want to acces to the component (created by a thread A) with an other thread B.
 
I invite you to read this tutorial about the multithreading :
 
 
Regards,

Nacer M. | Certified LabVIEW Architecte

0 Kudos
Message 2 of 2
(3,494 Views)