LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

setpanelattribute

Hello everyone,

I want to move a panel using a thread created with CmtScheduleThreadPoolFunction().

The panel was created in main() function and when start my thread I got this message:

 

NON-FATAL RUN-TIME ERROR:   "OnePanel.c", line 157, col 9, thread id 0x0000085C, function id 1:   Library function error (return value == -129 [0xffffff7f]). This panel operation can be performed (if a top-level panel) 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 can't create my panel from my thread. Another solution?

 

Thanks

Daniele

 

0 Kudos
Message 1 of 7
(4,373 Views)
The thread function could issue a PostDeferredCall to launch a function in the main thread that moves the panel, passing the coordinates of the desired position in callbackData parameter.


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?
Message 2 of 7
(4,370 Views)

Additionally, to move a panel you can use a single SetPanelPos instead of setting left and top attributes in 2 different instructions.



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 3 of 7
(4,355 Views)

Grazie Roberto.

0 Kudos
Message 4 of 7
(4,309 Views)

Can you expand on the solution? 

 

I'm having the the same error message when trying to move a panel with SetPanelPos() from one monitor to other (in extended desktop configuration ).

It seems the problem  is caused when I select as the front window one from another program (through ALT+TAB) before the SetPanelPos function is called.

 

I tried to google on the difference between a functiona nd a thread, but it will take a while to understand.

 

Please explain me why that simple, harmless function call may fatally fail like in my unresolved case.

 

Can this happen if the second monitor (where the pixel position given to the function as attributes is located) is not powered or something like that?

 

 

0 Kudos
Message 5 of 7
(3,858 Views)

Hello Sincrono,

your question seems totally unrelated with the original one. The poster opened this discussion about a very specific error in a multithreaded scenario, while from one of your sentences you seem unaware of multithreading issues.

I suggest you open a new thread instead, where you can give us some informations more about your problem so that somebody can share his experience:

- expected vs. actual behavior

- boundary conditions

- errors received, if any ('cause you are trapping UI errors, aren't you?)

- the relevant code you are using

- execution scenario (your note about dual-monitor environment can be crucial)



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 6 of 7
(3,846 Views)
Solved with postdeferredcall instead of a directc call to setpanelpos, from a void function outside main(). It seems that functions have to be of CVICALLBACK form to operate on panels.

Thanks
0 Kudos
Message 7 of 7
(3,723 Views)