LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to load a parent panel in a new thread

Hi,
for a communication dll, i need to load a panel witch visualize all the data transfered.
But as it's a dll, there's no "RunUserInterface" running.
I think the way is loading this visualization panel in a new thread.

The problem is that it's the only panel i need to load (then it's a parent panel)

How to?

Thanks
JMCe
0 Kudos
Message 1 of 7
(4,022 Views)
There's no reason a DLL can't call RunUserInterface.
When you use the UI Editor to create a user interface and generate the code for it, it creates functions InitUIForDLL which calls LoadPanelEx and DisplayPanel. It also includes a commented out call to RunUserInterface noting that you can run it from there or elsewhere in your code.
It's common in multi-threaded apps to have the user interface in one thread and other functions (liek data transfer) in another thread.
0 Kudos
Message 2 of 7
(3,996 Views)
You can look at some of the samples that ship with CVI like
...\CVI\samples\utility\Threading\ThreadPool\OnePanel\OnePanel.prj
and
...\CVI\samples\utility\Threading\ThreadPool\MultiPanel\MultiPanel.prj
0 Kudos
Message 3 of 7
(3,995 Views)
You can also look at ..\CVI\samples\dll\gui to see how to load a panel from a DLL, where the DLL is calling RunUserInterface.
Bilal Durrani
NI
0 Kudos
Message 4 of 7
(3,975 Views)
Hi,
to clarify, i never code any multithreading application, i'll try now !

I've looked for UI editor, and i don't find any reference to a InitUIForDLL function.
is it UI to Code converter in CVI 7.1 ??

Thanks

JMC
JMCe
0 Kudos
Message 5 of 7
(3,974 Views)
InitUIForDLL is a function that the UI Editor code generator creates for a DLL project with a user interface. In the sample program Bilal refers to, the function is called RunDLLUI. Look at that project.

You can see the code automatically generated by doing the following.
Create a new project.
In the project window, go to Build >> Target Type >> Dynamic Link Library
In the project window, go to File >> New >> User Interface
In the UI Editor, right-click on a blank spot and select Custom Controls >> Quit Button
In the UI Editor, go to Code >> Generate >> All Code.
Name and save any files as prompted.
0 Kudos
Message 6 of 7
(3,965 Views)

Hi all,

this dos'nt answer my problem.

I thinki've solved my problem  with this application i've developped last week :

a panel loaded in a new thread witch display results on the fly .

JMCe
0 Kudos
Message 7 of 7
(3,951 Views)