Jump to content

aehimself

Members
  • Content Count

    1090
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by aehimself

  1. aehimself

    Monitor Windows application and restart if needed

    Sure; this is why I added that the same can be implemented between applications. You have a watchdog application which queries your main application via TCP, window messages, mapped files, etc. The logic is the same, but instead of a watchdog thread you have a separate executable, and instead of a Boolean / TEvent the signaling channel is different. I personally would go with a window message which your main program has to reply to. Easy to implement on both sides: use SendMessageTimeout in the watchdog and one extra method in the main program.
  2. From this: It probable that AI didn't exactly say what you wanted to, but reading what you wrote tells me you want an IDE within an IDE as component and that makes no sense to me.
  3. Like... through a COM port. With an IDE within an IDE? I'm still not convinced.
  4. It seems to me you are attempting to reinvent the wheel. The criterias you listed are basically equal to an IDE... and why do you want to write an IDE as a Delphi component if there is an official one already? Afaik interaction with microcontrollers are still through serial ports (whether native or over USB) and there are even free components for Delphi to talk to a COM port. If you are sure you want to go through with this, I'd start there.
  5. aehimself

    Monitor Windows application and restart if needed

    When I had an error which caused my threads to lock up, until the issue was actually found and fixed I simply created a watchdog thread. It’s only job was to query the other threads and if they are found unresponsive, dump their remaining work queue, force-close, restart them and reload the work queue. The signal was a simple boolean called “alive”. The watchdog set this to false at each thread, and each thread set it to true within processing the queue. If the variable is false after 5 seconds (processing an item was < 1 s) it was considered hanging. You can implement the same logic within applications too, using window messages, TCP or memory mapped files as your signal.
  6. So the process of finding these is not that easy but not that hard either, I'll put it here so future visitors don't have to research / experiment. - Download @Anders Melander's Map2pdb, compile it and run it against your applications .map file. You'll get a .pdb file. - Download WinDbg and install it. Once done, go to File -> Settings -> Debugging settings and add the folder where your .pdb file is to the Symbol path list - Launch your application and when it's in the state you want to examine, go to File -> Attach to process and select your application. - In the lower-right pane select the "Threads" tab and double-click the offending one (TID = ThreadID in HEX) - Now go to the Stack tab and if everything is good, you get readable stack traces In my case @Stefan Glienke was absolutely right: As I am not using thread pools, I need to find out what does... and get rid of it, somehow...
  7. @mvanrijnen Did you find an effective way to debug this? My application started to do the same, with a similar call stack in the offending thread: It's important to note that this thread is not a worker of mine, I don't know what or when it was created. It also safely can be killed and won't cause any (noticable) disturbances. I also couldn't find a way to reproduce the issue, one time it just thinks it's time and then it locks up.
  8. In my experience when timing can cause errors it always can be tracked back to incorrect thread data / UI access. - Instead of just one critical section have one for each of your properties and enter / leave in every getter and setter. - Make sure none of your thread accesses any UI elements directly (e.g. Form1.Memo1.Text) - Make sure that every callback what your thread has is properly synchronized - A dialog IS a part of the VCL thread. Do not show any dialog boxes in any threads!
  9. Like we all never said “it works on my machine” 😄
  10. aehimself

    Delphi 12 is available

    Because Win7 is the upgrade of XP on kiosks and built-in devices. If even say ATMs.
  11. <Sarcasm> Considering the pricetag on Delphi they might still be saving for it xD </Sarcasm>
  12. We upgraded to Delphi 11.2 at work a few weeks before 11.3 came out and using it ever since. We have at least 15 3rd party components installed, plus our own ones derived from those. The only IDE error we have is the occasional “internal error” which can be avoided by using Shift-F9. While the quality of LSP in Delphi 11 was questionable indeed I still strongly disagree with you on this. Delphi 11 really did not suffer from any other major defects.
  13. aehimself

    PPPoW simply for Delphi XE Starter

    I'm not entirely sure if that is the case but what I understood you want to write your own program to communicate with (and maybe to control) said thremostat. To do that you'll either have to have the full protocol description used (which the manufacturer can provide) OR you have to reverse-engineer it by yourself. Be warned though - reverse-engineering even a part of a propriatery solution might be completely forbidden by the EULA and / or your regional law so make sure you are permitted to do so. If you can and would like to proceeed you don't need any Delphi application for that; just install Wireshark and connect with your PC program. That will give you enough hints to start.
  14. aehimself

    Thread Destroy with no corresponding Thread Create?

    If you have FreeOnTerminate := True and you call .Free, you can have 2 destructors but one will raise an AV as you are .Free.ing the StringStream instead of FreeAndNil.
  15. Hello, I have an application which utilizes DimPanels. A couple of days ago I was notified that there are some buttons barely visible; however they are supposed to be on a solid background. The issue is, something is being drawn different when the application is executed in an RDP window. Locally I receive a solid form while through RDP everything is transparent, revealing the component underneath: Attached is the minimum test case... it simply creates a DimPanel on the form and embeds an empty frame into it. The solution is rather easy: enable ParentBackground in the DimPanel or disable ParentBackground on the frame. My question is; does anyone know why drawing differs? DimPanelTest.7z
  16. aehimself

    Delphi 12 VCL painting differs through RDP

    Talking about the small program I attached; it is not present in the code or in the DFM - you are right about that. That means it is using the default, which is False for DoubleBuffering. At least this is how I believe it should work.
  17. aehimself

    Delphi 12 VCL painting differs through RDP

    Aaaaand jackpot! Adding Application.SingleBufferingInRemoteSessions := False solves the issue for good, no more dimmed memo is visible through RDP! The only question which I have remaining - if DoubleBuffered is false everywhere in the test application, how come enforcing single buffering makes a difference? Shouldn't that be the default, if .DoubleBuffered is false on the form and on the frame?
  18. aehimself

    Delphi 12 VCL painting differs through RDP

    Even if DoubleBuffered is on for the frame and the form, and Application.SingleBufferingInRemoteSessions is true, I still see the memo in the test application if I execute it in an RDP window. No, double buffering seems to have no effect on this particular issue.
  19. aehimself

    Delphi 12 VCL painting differs through RDP

    Interesting read! Do I understand it correctly that if you do NOT override anything, themed and un-themed controls do not use double buffering (even if set in object inspector) if a remote session is detected? If yes, it means we can completely exclude double buffering as a potentional suspect for this particular issue. But, it actually reminded me to also note: the issue only appears on the system (Windows) style. If any custom style is selected, the frame (panel?) will become solid again.
  20. aehimself

    Delphi 12 VCL painting differs through RDP

    Double buffering is a valid point as it's turned on in my main application. It is however is off in the test program, and unfortunately enabling it (and changing DoubleBufferedMode) doesn't change the behaviour.
  21. aehimself

    Delphi 12 VCL painting differs through RDP

    Logging on to the same machine with the console session does not reproduce the issue. Also, I doubt RDP is at fault, as it only affects Delphi 12 binaries.
  22. aehimself

    Delphi 12 VCL painting differs through RDP

    Confirmed. When building the same project with Delphi 11.2 the panel shows up solid, so this seems to be a Delphi 12 "issue". ...but why only through RDP? Edit: updated topic title
  23. aehimself

    Delphi 12 VCL painting differs through RDP

    Well that’s something I didn’t think of as a possible root cause, that’s why I did not mention that I am using D12 to compile. I tried on remote Windows 10 and Server 2019, both behaved the same way. I’ll check with some earlier Delphi versions.
  24. aehimself

    Delphi 12 VCL painting differs through RDP

    Settings are the highest possible as I was testing it on a local VM where connection speed isn't an issue. While the idea is good, disabling bitmap caching did not solve the issue. What I am really interested of is that in DimPanel I am not calling inherited in the overridden Paint method. How come ParentBackground has any actual effect...? Probably some weird window message to set the color, I don't know...
  25. aehimself

    Typo in TWMDPI record in Delphi 10 Seattle ?

    It seems the typo was not very long lived. Delphi 10 Seattle Delphi 10.1 Berlin Update 2
×