05-08-2007 02:52 AM
Hello all and thanks for your answers.
I'll try to explain how my app is working .
It is really a win32 app, and its main thread consists of a 'while' which responds to windows messages.
Before entering this while, I launch my CVI_Thread (which just initializes everything in CVI and calls to RunUserInterface()) so this thread is responsible for respondig to user interaction -pushing controls- in CVI. I also launch my LAN_Thread, which waits for LAN Messages (through sockets).
So when I say that the Listbox updates correctly with user interaction, I mean that when I click a control (for example 'add item to the list'), I launch a normal CVI CALLBACK and this callback (which is attended automatically by my CVI_Thread and its RunUserInterfce() loop) calls for the control to update and the changes appear on the control right away. So I don't make any call to ProcessDrawEvents(), this is what I meant when I said that I called for the control to update.
The problem is that when I receive a message through LAN_Thread with new items, I also call for an update of the ListBox Control, the changes on the control doesn't appear.
Now on with the solutions. As I mentioned in past posts, the only solution that has proven right for me is to turn the attribute VISIBLE 'off' and then 'on' again on the ListBox Control after making the changes on it. The last values now appear but the effect is that the Control 'blinks', which causes a very bad effect on my app.
I have tried to make a 'PostDeferredCallToThread' to a function in the CVI_Thread upon receiving the LAN Message. This function updates the listbox with the items received in the LAN Message. But this didn't work, as the ListBox Control wouldn't update to show the new values.
Right now I'm out of ideas, and I'm going with the blinking solution.
Daniel
05-08-2007 05:22 PM
05-09-2007 02:48 PM