LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using DiscardPanel

I am getting the error "panel operation can be performed (if a top level) only in the thread in which the panel was created, or (if a child panel) only in the thread in which the top-level parent panel was created."

 

I am using CmtScheduleThreadPoolFunction twice in order to open two of the same panels but with different panel IDs. The second one closes fine with a quit callback but the first one produces the runtime error above. How do I get back to that thread in order to close it?

0 Kudos
Message 1 of 2
(961 Views)

An option could be to issue a PostDeferredCallToThread () and close the panel in the deferred callback. You'll need to get the thread ID by calling CmtGetCurrentThreadID () from within the thread and save it somewhere for this mechanism to work.

But you have to investigate on why the last call succeeds and the first one does not.



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 2
(913 Views)