Jump to content

aehimself

Members
  • Content Count

    1028
  • Joined

  • Last visited

  • Days Won

    22

Posts posted by aehimself


  1. I know, I should write some documentation about most of my stuff...

    Until then, there's a minimum example on how to create a sample update file in this post.

     

    However, I started thinking. If you simply want to show it, why not a simple TMemo, which loads the information from a .TXT file / embedded resource / HTTP?


  2. I started to experiment with Delphi 12 shortly after it came out at work with a fairly large project. It is using ~100 home-brewn components, consists of thousands of frames (with multiple levels of visual inheritance which is a deathbed for Delphi as far as I recall) in about 1,5M LOC (excluding all external packages which we use from DCU).

     

    Until we make the decision to officially switch I'll keep using Delphi 12 as a daily driver, supporting the same codebase as everyone else and in my experience even the unpatched Delphi 12 gave less internal errors than 11.2 (which we are currently on).


  3. You can go extremely hacky and create a "transparent" panel - and simply put all your components on this. Since TPanel is a TWinControl descendant, .BringToFront will work properly on it.

     

    You can use the source here, just change the painting slightly:

     

    Procedure TDimPanel.Paint;
    Begin
      // Omit the call to inherited in general. 
      
      Self.Canvas.Draw(0, 0, _bitmap, 255);  // Might need 0 instead of 255 for opacity - I don't know by heart
    End;

     


  4. The only “issue” I personally experienced with DCPCrypt was string encoding. While a PHP library was working on UTF8, using the built-in functions of DCPCrypt used Unicode - there’s why the end result didn’t match.

    Once I converted my string to UTF8 TBytes and encoded that everything started to work perfectly.


  5. So you use a program to even write the question for you and when we don’t get what you wanted at the first place you get frustrated; am I getting this right?

     

    Don’t forget that this forum is to discuss, share and help one another; not to do what you don’t/can’t even state clearly.

     

    I wish the best of luck with your project. I spent way too much time figuring out what you want.


  6. 35 minutes ago, bdw_nz20 said:

    It can take time to narrow down whats going wrong and where, hence the need for this type of watchdog on the main thread.

    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.


  7. 1 hour ago, techdesk said:

    I dont understand your post. How does "creating a simple to use VCL component for Delphi"  relate to an IDE within an IDE.
    " Quote- "Silence is the shield of fools"..

    From this:

    20 hours ago, techdesk said:

    A "drop into form" component that allows users to effortlessly incorporate STM32 board functionality into their Delphi projects.

    [...]

    A user-friendly interface featuring a drop-down menu listing popular boards like NUCLEO, DISCOVERY, and BLUE-PILL.

    [...]

    Once configured, users should be able to execute read and write operations with ease, leveraging familiar STM32Cube IDE commands and parameters.

    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.


  8. 2 hours ago, techdesk said:

    with specialized commands catered to drones equipped with STM32 chipsets.

    Like... through a COM port.

     

    2 hours ago, techdesk said:

    In essence, Delphi empowers you to push the boundaries of what's possible with the STM32 chip, unleashing your creativity and ingenuity to create groundbreaking solutions that defy expectations.

    With an IDE within an IDE? I'm still not convinced.


  9. 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.

    • Like 1

  10. 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.


  11.  

    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:

     

    image.thumb.png.4c18204b065d4f95d0a01cc68b090c9b.png

     

    As I am not using thread pools, I need to find out what does... and get rid of it, somehow...

     

    • Thanks 1

  12. @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:

     

    image.png.04890ac24a1139537895fd8c112b4826.png

     

    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.


  13. 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!


  14. 13 hours ago, mel2024 said:

    I am real tell me then why Edge Browser is still supporting windows 32bit and windows 7???
    have you got an answer?

    Because Win7 is the upgrade of XP on kiosks and built-in devices. If even say ATMs.


  15. 7 hours ago, gioma said:

    I REPEAT: The problem with Delphi 11 is that the more you use it, the more it corrupts, until it becomes almost unusable!.

    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.


  16. 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.

×