LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI Run-time error during trying to use DiscardPanel function

    I desicribe my problem here. Details please see attached screenshot.
   Two UIR file, one is the main.UIR, which will call the other about.UIR. they are located into two seperate threadS, In the same thread, I operate about.uir by using "LoadPanel" and "DiscardPanel". To be frustrated, I got a run-time error, which is saying: "This panel operation can be performed only in th thread in which the panel was created, or only in the thread in which the top-level parent panel was created."
   I could understand this error msg, but I prefer to have a way to resolve my problem 
 
 
Thanks!
Jacky
0 Kudos
Message 1 of 4
(3,409 Views)
Jacky, in my opinion the error arises because you are loading the panel and assigning its handle to g_popupHandle variable, while you are discarding g_popupFlag. Supposint this variable assumes value 1, this means discarding the main panel, which you cannot do in a thread other than the main thread.
By the way, it's not necessary to call DisplayPanel if you are using InstallPopup on the same handle.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,397 Views)
Hi You are right.It's a shame for me to have made such a stupid mistake. Thanks! Jacky
0 Kudos
Message 3 of 4
(3,386 Views)
Don't be ashamed, Jacky: everyone of us has fallen into such kind of errors. Sometimes it happens to me to look repeatedly and carefully at some lines of code without catching some obvious mistake since I am really "reading" what I "should" have written, not what I actually wrote! Smiley Surprised
If I can't get someone else's look to the code I normally freeze the problem and come back to it after a night of rest: usually I succeed in getting the errors! Smiley Wink


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(3,378 Views)