OnPaint cannot contain Application.ProcessMessages (6.53)

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #33507
    HeDiBo
    Participant

    Putting Application.ProcessMessages inside the OnPaint event of a form will hang the application. See [attachment=3687:AuSync.rar]

    #41467
    HeDiBo
    Participant

    This problem has more ramifications: if during the paint event, a dialog is created, that dialog is not shown

    #41500
    HeDiBo
    Participant

    I think there is more to it. I have removed the Application.ProcessMessages and the OnPaint event. Now, many times, when I start the application it does not show the initial screen and appears to be hanging (at least in the debugger of the Delphi development environment). Only a process reset and restart will fix it, albeit a few restarts may be needed.
    Debugging reveals the application is looping in the windows message retrieval loop. In other words: some needed message has not arrived.
    I consider this a serious bug

    #41520
    HeDiBo
    Participant

    Serge, Did you have a chance to look at this one? dry.gif

    #41529
    Support
    Keymaster

    Hello
    I'm sorry for delay, all topics are answered in order from bottom (from old topics) to top of the list…
    Cause of your problem in a form animation. Set sSkinManager1.AnimEffects.FormShow.Active to False and looping will not be occured in this case.

    #41533
    HeDiBo
    Participant

    Is this the solution? Or is it a bug (I would say it's a bug)

    #41554
    HeDiBo
    Participant

    QUOTE (HeDiBo @ Jan 28 2010, 05:13 PM)
    Is this the solution? Or is it a bug (I would say it's a bug) <img src="style_emoticons//happy.gif” style=”vertical-align:middle” emoid=”^_^” border=”0″ alt=”happy.gif” />


    In the new release (6.54), this bug has become horrible. I cannot debug my project anymore! It simply hangs on startup. I have set the sSkinManager1.AnimEffects.FormShow.Active to False. It doesn't help.

    It appears to have to do with a form that's autocreated in the DPR file. If I create that form dynamically in the main form there's no problem.
    The form in question contains among others a custom form resizer, that resizes the form and all its controls dynamically upon request. The resize operation is not done though; only the current size is saved at the form create time.
    This is the open source form resizer: [attachment=3726:EasySize.rar]
    HELP <img src="style_emoticons//huh.gif” style=”vertical-align:middle” emoid=”:huh:” border=”0″ alt=”huh.gif” />

    #41559
    Support
    Keymaster

    Hello

    In the v6.54 the problem with OnPaint must be solved, your demo was tested in several Delphi versions and haven't the problem now (animation state is not important now).
    I have installed TFormResizer and check it too, but can't receive an issue. How you are using this component? Could you help me to reproduce the problem?

    #41567
    HeDiBo
    Participant

    QUOTE (Support @ Feb 2 2010, 08:19 AM) <{POST_SNAPBACK}>
    I have installed TFormResizer and check it too, but can't receive an issue. How you are using this component? Could you help me to reproduce the problem?


    Here is a test application that hangs when started (with Run) from the IDE of Delphi 7.

    I think the problem is more in another component: AuAniBmp. If I remove that one from the Aura_messager form the problem disappears.
    So, I've included that component. And the ThreadedTimer it uses. I think it's complete now, but if you miss something please let me know.

    Remember, the problem only appears if you run the application from the IDE under the Delphi debugger. Not if you start it stand-alone.

    [attachment=3732:AppHang.rar]

    #41569
    Support
    Keymaster

    Thank you.
    What is TBCBitmap? (abort_icon: TBCBitmap;)

    #41577
    HeDiBo
    Participant

    QUOTE (Support @ Feb 2 2010, 12:29 PM) <{POST_SNAPBACK}>
    Thank you.
    What is TBCBitmap? (abort_icon: TBCBitmap;)


    Don't worry, just replace it with a standard bitmap.

    #41578
    HeDiBo
    Participant

    I'm getting a bit nearer to the problem.
    If you place an extra statement in the DPR file like this:

    SetProcessAffinityMask(GetCurrentProcess, 1);

    and add a

    use Windows,

    to the top, the problem goes away.
    This is a problem occurring with hyperthreaded CPU's and Delphi 7.

    So, unless you have a hyperthreaded CPU, you cannot reproduce it!

    Now that I found it, I don't think AlphaControls is to blame. Just because it incurs extra processing this old bug resurfaces.

    #41619
    HeDiBo
    Participant

    Unfortunately, despite all measures I took, the program still appears to be hanging sometimes at start-up.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.