LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Web Browser ActiveX control with multiple threads in CVI

Hi Scott,

The change you suggested works perfectly, thank you.

I have a couple of questions regarding the changes you made:

If I create a panel on a different thread using the PostDeferredCallToThread (to create it on the main thread as a child panel), must I also use PostDeferredCallToThread for all the panel related operations? (Change the value of text boxes, change color of decorations, etc.) is there a written explanation on this subject?

Why did you choose to use the CreateThread function (WIN API) and not the cmtScheduleThreadPool function (CVI)?


Thanks again,

Gil
0 Kudos
Message 11 of 14
(1,394 Views)
Hi Gil,

I had changed the function used to start new threads purely as a trouble shooting step. There should not be any issues with starting the threads using your first method.

After taking closer look at your application, there is really no advantage to creating new threads for each panel. Each new panel must be loaded in the same thread as your main panel for it to be a sub panel. All the work is being done by this main panel thread in this case, so there is no reason to spawn a new thread for each panel. I would suggest illuminating the multithreading and creating each sub panel with a callback function in the same thread as the main panel.

Scott Y
NI
Message 12 of 14
(1,377 Views)
Hi Scott,
I understand it now and will use your advice.

Regards,

Gil
0 Kudos
Message 13 of 14
(1,372 Views)
For future reference, you can find more information about creating multi threaded user interfaces using CVI in the CVI Help Content. Under the Contents tab, go to Library Reference >> User Interface Library >> Multithreading.

Hope this helps
Bilal Durrani
NI
0 Kudos
Message 14 of 14
(1,366 Views)