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: 

My program hangs when using 'RunPopupMenu'

I have my CVI5.5SP1 application running in W2K with 3 threads. The main thread calls to 'RunPopupMenu' and the program hangs. No error message appears. Do you have any idea?. Also when clicking on the menu bar the program hangs with no error message. It happens on W2K only, not in WNT or W98.
0 Kudos
Message 1 of 4
(2,789 Views)
Hi,

Multithreaded applications can be hard to debug or find a problem. What is strange in this case is the fact that it worked in another OS. This could also tell us that the problem may be related to the way Windows 2000 manages the memory. The first thing to check is to be careful when sending data between threads, probably Win 2000 will be stricter in memory sharing. There is a good explanation on data protection in C:\Program Files\National Instruments\MeasurementStudio\CVI\bin\multithreadingOverview.pdf.

I hope this info helps, but keep me posted!

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 4
(2,789 Views)
Ok, I have solved the problem by 'Locking' the function 'RunPopupMenu'. It seems a video memory problem or video driver, because I have test in other PC's and no problem appears. It happens when using multithreading and executing the RunPopupMenu. First I meke a RunPopupMenu at the beggining of the program and breaks. Then I 'Locked' the function and works but I have a Menu in the main panel. I need to click anywhere for the menu to disappear and relase the Lock for the program to start. Then I create other thread to meke the menu disappear and works. For last, I tried to hide the menu at the main panel by taking it to coordinetes 32000,32000 and it hangs again, the menu mist be vissible. A popup menu must be displayed and vissible in a locked function to have the opti
on to run the 'RunPopupMenu' in a multithreaded application running in Windows 2000.
0 Kudos
Message 3 of 4
(2,789 Views)
I'm glad you are over this now, this is very good information "A popup menu must be displayed and vissible in a locked function to have the option to run the 'RunPopupMenu' in a multithreaded application running in Windows 2000"

Regards,

Juan Carlos
0 Kudos
Message 4 of 4
(2,789 Views)