From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

QuitUserInterface(0) from within a child thread

Is there a solution for the case when I want to call QuitUserInterface(0)
function from within a child thread while the RunUserInterface() function
is located in the main application thread ?
0 Kudos
Message 1 of 3
(3,300 Views)
what do you want to do exactly ?.
It's very strange to call quiUserInterface(0) from inside a new thread.

Daniel Bentolila a écrit dans le message :
38bbb2dd@newsgroups.ni.com...
>
> Is there a solution for the case when I want to call QuitUserInterface(0)
> function from within a child thread while the RunUserInterface() function
> is located in the main application thread ?
0 Kudos
Message 2 of 3
(3,299 Views)
"Pierre DURIEZ" wrote:
>what do you want to do exactly ?.>It's very strange to call quiUserInterface(0)
from inside a new thread.>>Daniel Bentolila a écrit dans
le message :>38bbb2dd@newsgroups.ni.com...>>>> Is there a solution for the
case when I want to call QuitUserInterface(0)>> function from within a child
thread while the RunUserInterface() function>> is located in the main application
thread ?>>



Well this application is a multithreaded app. which has a panel so it calls
the RunUserInterface() from the main thread, but just before call RunUserInterface()
I call SetEvent function (of the Win32 SDK pack.) and then it starts to perform
some tasks where each task is a different thread, and in one of those ta
sks
i'd like to exit the application due to some condition no matter what it
is, so I have to call QuitUserInterface() if I want to exit normaly but again
it doesn't work, minwhile I found some solution by using RegisterWindowMessage
and PostMessage mechanism where I call the RegisterWindowMessage with a pointer
to a function in which there I call QuitUserInterface , in such way that
function belongs to the main thread, where in the child thread which I want
to exit from, I call to PostMessage and this raises the registered function
which calls QuitUserInterface(0) and seems to work properly.
0 Kudos
Message 3 of 3
(3,300 Views)