Jump to content

Anders Melander

Members
  • Content Count

    2330
  • Joined

  • Last visited

  • Days Won

    121

Anders Melander last won the day on May 28

Anders Melander had the most liked content!

Community Reputation

1673 Excellent

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Anders Melander

    How to debug a Not Responding program element

    No and it isn't needed in this particular case. How about you have a peek at the code before you continue?
  2. Anders Melander

    How to debug a Not Responding program element

    Okay but lack of imagination isn't a reason to eliminate it 🙂 The use of Sleep in OnIdle is definitely a problem but that doesn't mean that all use of Sleep in the main thread is bad. For example, the fade in/out code is a time limited (sub-second duration) loop containing a Sleep. While the fade in/out is in progress nothing else happens and nothing else should happen. It would be silly to complicate this with threads or timers.
  3. Anders Melander

    How to debug a Not Responding program element

    It would probably be best if you had looked at the code before making such a broad recommendation... I haven't looked through all the code but I'm certain there at least some cases where it would make no sense to replace Sleep. I know because I wrote that code.
  4. Anders Melander

    How to debug a Not Responding program element

    That's the spirit! I must say that given that you're a relative noob (no disrespect; We've all been there 🙂 ) I am pretty impressed with your determination and with what you've done with SuperLemmix. From what I've seen it's not the easiest of projects to work with.
  5. Anders Melander

    How to debug a Not Responding program element

    It's the first in the thread list: No; You do both: Use the timer to trigger the animation. Use GetTickCount to calculate which frame to display. I would probably stop the timer at the start of the OnTimer handler and start it again at the end, in order to avoid a flood of timer messages if the handling is too slow. If you move the animation out of OnIdle, remember to change the OnIdle handler so it sets Done=True (instead of False, like now). This way the OnIdle handler will not get called continuously. Also take care to not do anything in it that will produce windows messages. If it's almost too fast to warrant a progress bar then simply introduce a tiny delay. You might make the load slightly slower but the user experience might be better. Looks good. This might be a bit too advanced for you at the moment, but I would strongly suggest that you make each element (e.g. each button) a layer. It will make the interaction and control of the elements so much easier and perform much better since it utilizes TImage32's built-in repaint optimizer to avoid the current whole-scene repaints. I have a local branch for NeoLemmix where I changed the main menu screen to use layers for the scroller/banner, logo, buttons, etc. but I had to abandon it since working on NeoLemmix was basically just procrastination.
  6. Anders Melander

    DocInsight 2024 Sneak Preview and Beta Invitation

    That's nice I guess but No support for external XML documentation files. This is a complete showstopper; 1) I'm not mangling our source with doc comments, 2) Some of our source is generated. The comments would be overwritten. The layout is still hard coded to emulate the VS2012 help. I don't mind the style but without the possibility to adapt the content to an existing layout the generated help just looks bolted on.
  7. Anders Melander

    Windows PATH length limit?

    Similarly unrelated, the MAX_PATH limitation can also be circumvented with the manifest: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#longPathAware
  8. Anders Melander

    How to debug a Not Responding program element

    If you still have madExcept installed you can enable leak detection in it, recompile, run, exit and it will produce a nice list where you can double-click each entry and it will take you to the exact source line where the leaked resource was allocated. I just tried with Neolemmix; Run, exit, tons of leaks: This is the direct result of running the animation loop from Application.OnIdle with Done=False. Replacing it with a timer would solve that problem. That problem can probably be "solved" by simply displaying a progress bar while the files are being processed; Users are willing to tolerate quite a lot of delay as long as they know why they are waiting and can see some progress.
  9. Anders Melander

    How to debug a Not Responding program element

    Okay, so you are doing something in Application.OnIdle. My guess is that you are doing too much (it's taking too long) and thus slowing everything down. Application.OnIdle is called inside the message pump loop when the the message queue is empty. If you do something in OnIdle that take a bit too long the message pump will be slow to react to new messages in the queue. It could also be that you produce a lot of new messages in OnIdle and thus flood the message queue and keep the loop busy all the time. My guess is that OnIdle is used for animation so the messages are probably mostly WM_PAINT and WM_TIMER. Anyway, have a look at what the OnIdle handler is doing. Does the problem go away if you disable that?
  10. Anders Melander

    How to debug a Not Responding program element

    You must be thinking of DOS/Windows 3.x. All version of Windows since Windows 95 has supported threading. Your screenshots aren't really showing us the call stack. Make sure that after your pause that you switch to the main thread (open the thread list, double click the topmost thread). I would keep madExcept installed if I were you and occasionally enable its memory overwrite detection for your application. That is how I found and fixed some of the memory overrun bugs in NeoLemmix.
  11. Anders Melander

    How to debug a Not Responding program element

    With regard to madExcept; Nothing. You just enable it for your project, check the freeze detection and run the application. If the application isn't pumping the message queue then madExcept will detect that and pop up its usual message box with a stack trace and options to terminate, restart, etc. However, you would only need to do all this if you cannot reproduce the problem in the debugger. If you can reproduce in the debugger you will get the exact same information by just pausing the application and examining the call stack of the main thread in the debugger. No. I believe it was possible to break into the debugger using F12 in Windows XP but I think that option was removed (by Microsoft). I have a registry hack somewhere that enables it again, but I don't have time to find it right now. I think it's related to this: https://learn.microsoft.com/en-us/windows/win32/debug/configuring-automatic-debugging Maybe someone else here knows the answer.
  12. Anders Melander

    Free profiler?

    That's @Eric Grange You can send him a DM here.
  13. Anders Melander

    What are the performance profilers for Delphi 12?

    ...but only briefly mentions VTune 🤔. A bit of a missed opportunity there.
  14. Anders Melander

    Product: Delphi Parser - AI claims - what does it mean?

    The amount of meme-worthy bullshit he's managed to squeeze into that site is actually quite impressive; There's layers upon layers of it. You can almost hear the feedback loop caused by believing your own marketing.
  15. Anders Melander

    Access violation installing a component

    Ugh. Rewritten in C# using WPF, It's ironic that they've named the new application "Dependencies"; The old one had 1 DLL. The new has 54 DLLs.
×