LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to block all callbacks from Toolbar?

I noticed there are many callbacks going in Toolbar such as ToolbarCallback, ParentPanelCallback, HelpPanelCallback. I want to block all those callbacks when I call ProcessSystemEvents(). Does anyone know how to do that? Thanks.
 
0 Kudos
Message 1 of 7
(3,643 Views)

I'm not aware of any explicit command to disable those callbacks.

Since all of those functions are relate to the tollbar being operated, probably the best way to have those functions do nothing is that of hiding the toolbar before entering your critical section of code and enabling it after.

As an alternative, you could modifiy tollbar code to customize it to your desire: not so easy since you'll have to carefully study that code before attempting to modify it.



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 7
(3,632 Views)

Thanks. What about my other questions posted yesterday? I need to know how much time is spent in reading data from hardware in my second thread. So I have to use Timer (). But as I mentioned in my yesterday's post, the computer will freeze when I call Timer (). Do you have any good solutions? Thanks.

 

0 Kudos
Message 3 of 7
(3,631 Views)
Are you afraid the computer will freeze of have you verified it has frozen?
 
I was looking into ToolbarPanelCallback, and the only reference to the timer I found is in SetPollTimer routine, which is called with NORESET as the last parameter: with this option, SetPollTimer is not expected to reset the timer.
This looking into toolbar.c code distributed with CVI 7.1.


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 7
(3,628 Views)

Here is what I found in Toolbar.c

errChk (SetPollTimer (toolbar, ENABLE, SLOW_POLL_FOR_HELP, RESET));

You mean I should set RESET as NONRESET to solve my problem?

Thanks.

 

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

Which version of CVI are you using?

In my code (version 7.1 as already noted) ToolbarPanelCallback calls SetPollTimer (toolbar, ENABLE, FAST_POLL_FOR_HELP, NORESET); without errchk macro.

This function is always called with NORESET parameter except inside Toolbar_DisplayInternal function, which is called by several update functions inside the instrument (add or discard a button and so on) but NOT from ToolbarPanelCallback.



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,622 Views)

Sorry, I looked at the wrong place. I am also using CVI7.1. Could you please take a look at the problem I posted yesterday? computer frozen in secondary thread

Thanks.

 

0 Kudos
Message 7 of 7
(3,616 Views)