Display Issues with VB App

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrgasc
    New Member
    • Jan 2007
    • 2

    #1

    Display Issues with VB App

    I have a data aquisition program written in VB6 that suffers from sporadic graphical issues. The UI is full-screen and at various times while the program is running, specifically when the computer is communicating with the data acquisition system or completing sample, large white boxes will show up and odscure the display. Once the sample has completed and the screen is refreshed, these will go away. I believe that I have an adequate number of refreshes right now. As mentioned previously, this problem occurs most often during a data acquisition and no information is actually changing on the UI. I'm really scratching my head on this and would very much like to resolve it. It is a great nuisance on the end-user. Are there any ideas on what could be causing this or what I could do to correct it?
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Hi. Sounds like you just have to put up with it or write multi threaded code that puts screen refresh on a different thread from your data processes. Anytime there is heavy processing going on the screen refresh takes second place. The only thing that I can think of that will get you out of this sometimes is liberal use of DoEvents. This pauses your data processes to allow windows to update the GUI etc.

    Good luck

    Comment

    • mrgasc
      New Member
      • Jan 2007
      • 2

      #3
      Originally posted by willakawill
      Hi. Sounds like you just have to put up with it or write multi threaded code that puts screen refresh on a different thread from your data processes. Anytime there is heavy processing going on the screen refresh takes second place. The only thing that I can think of that will get you out of this sometimes is liberal use of DoEvents. This pauses your data processes to allow windows to update the GUI etc.

      Good luck
      Well, that's a bummer. I've experimented with DoEvents, as well as Refresh and GotFocus, but I have yet to find the "magic bullet" that corrects the problem. Thanks a lot for the reply.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by mrgasc
        Well, that's a bummer. I've experimented with DoEvents, as well as Refresh and GotFocus, but I have yet to find the "magic bullet" that corrects the problem. Thanks a lot for the reply.
        There may not be much you can do along these lines, because (I'm guessing here) control probably doesn't return to your code until after the communication. Hence you can't do anything while it's in progress.

        I can think of a couple of ideas to try out, though.
        • Perhaps your last refresh before the communication pause is being interrupted. Could you introduce a slight pause (including DoEvents to allow Windows to do its thing) before hitting the comms? This is a long shot, admittedly.
        • Have you tried locking the window to prevent any updating until control comes back? I have no idea whether this will work, but check out the API call - um, it's something like LockWindowUpdat e. Perhaps "freezing" the window will prevent the boxes appearing. Grasping at another straw here of course, but you never know your luck until you try.

        Comment

        Working...