Jump to content

gioma

Members
  • Content Count

    115
  • Joined

  • Last visited

Posts posted by gioma


  1. 40 minutes ago, Brian Evans said:

    Short answer: No test case no fix.

     

    They do squash bugs when they have good descriptions and can be reproduced reliably. That makes it possible to see, understand, debug, fix and confirm the fix. The release and patch cycles are a bit slow, but it is what it is at this point. 

     

    I have solved similar freezing issues before, but none were due to Delphi itself. Windows APIs tend to hang when trying to access non-existent network resources. Some old projects referenced common libraries on network shares on servers long gone but still in DNS. Strangest case was dead batteries in a RAID card which caused a Windows cluster to not use write caching - writes were only considered done when they hit the physical disks. Throughput dropped hilariously low for the hardware involved bottlenecking everything. That makes finding a freezing issue in Delphi itself harder without a way to reproduce as what a customer sees might not be due to Delphi itself. 

     

    Seems like a catch-22 at this point: the freezing robs time from the same people we need to spend time on troubleshooting and trying to find a test case. 

    The fact that the IDE gives an "out of memory" error and freezes is not due to the operating system but to the Delphi engine which jams over time. In fact, the longer you keep Delphi open, the slower it will be to compile or debug. I have a 64-bit project and I had to give up debugging as it is extremely slow and inefficient (some functions can take minutes) despite taking up little RAM and CPU cycles.😭

     

    I would like to point out that time is money for professional programmers, so I cannot and must not waste time patching software that should make my life easier and for which I pay a high price.

     

    20 minutes ago, Mike Torrettinni said:

     

    I agree with your conclusions and as said above, it's been the same with small improvements for years, so I just accepted it.

     

    I use these 'tricks' on a daily basis and consider them as part of development workflow:

    - highlighting words fails when code is folded, so I unfold all the code in unit I work on

    - use Kill task to kill LSP multiple times a day (https://stackoverflow.com/questions/74164165/is-there-a-way-to-setup-a-shortcut-to-re-run-the-delphi-lsp-instances)

    - when IDE starts acting up (bookmarks behaving strangely, watch window shows odd values, debugger hangs or slows down...) - restart IDE

    - search will likely start with Whole words checked, so check the status of Whole words regularly

    - 64 bit debugger requires special attention, so handle with care and don't be impatient

    and probably some more that I can't remember right now...

     

    As mentioned above, time is money and restarting the IDE 5/6 times a day is an unthinkable waste of time!😥

     

    I hope someone who works for Embarcadero reads this post and realises what programming in Delphi means today.

    NB
    I love the Delphi language, but I can't program in Delphi 2007 (which doesn't cause major problems and therefore doesn't waste time writing code...) in 2023!


  2. 3 minutes ago, Der schöne Günther said:

    To be honest, I don't think any of this is new - It's been like this for several years now. I've just come to accept it.

      

    Over the last years, the IDE has gotten better, but just cannot compete with others , it's in a league of its own. For example, Visual Studio 2017 got its last bugfix in August 2023. Now imagine Delphi 10.2 still getting fixes...

    Unfortunately, I know that this is the case, but I don't think it's the right and most importantly respectful way to go for the companies that continue to invest in Delphi.
    Imagine that those upgrading to Delphi 12 now have to reinstall all the components without any certainty that the old bugs have been fixed. In fact, it's almost certain that the bugs are still there!

    Why should I, as a software company, think about developing a new application using Delphi? I mean, having used this IDE for twenty years, I would never think of it!

    Delphi is staying afloat thanks to all the applications that are still hanging on, but what happens when they are finished?

    I mean, even though my project consists of hundreds of thousands of lines of code, I have often thought about moving on to something else, and I have built some of his modules using Visual Studio.

    I do not understand or agree with Embarcadero's policy of not releasing bug fixes on a regular basis and instead releasing a new version of Delphi every year.


  3. I want to share my disappointment with you.
    I work with Delphi 11.3 (Patch 1) and every day I see amazing things.

    Starting with Code Insight, which works 1 out of 3 times. Then, when it stops working, there is no way to reactivate it.

    The new feature that allows you to highlight the selected words in the code works badly, often when I select a word with a double click the document is moved and becomes unreadable until I scroll through the document, this thing makes me waste a LOT of TIME.
    It is also dangerous because you risk to write in another part of the code! (it happened to me...)

    When I am working on the graphical interface of a form, it can happen that the IDE freezes completely and I have to force the PID to close!

    Sometimes the compiler goes "out of memory" and in the best case you can save and close Delphi, in the worst case Delphi crashes and you lose the work you've done if you haven't saved it.

    And those are just the biggest problems, I'll leave the rest out.

    Now I learn that Delphi 12 is being released, but how can Embarcadero offer me a new version of Delphi? And the Delphi 11 bugs, WHO CAN SOLVE THEM?
    The last update to Delphi 11 was in APRIL!!!!

    This means that I should update to Delphi 12, which will certainly have NEW BUGS and will not have fixed the bugs of version 11 (as happened to me every time I changed versions...).

    When do you think we will be able to go on like this? Visual Studio is updated EVERY WEEK.
    I have to work every day with an IDE that slows me down and most of all with an IDE that NO ONE MAINTAINS!
    I would like someone like Marco Cantù to explain to me why Embarcadero is destroying the trust of their customers in this way, why they are neglecting the essentials to continue blowing smoke in our faces.

    Sorry for the outburst, but it's really frustrating to work like this.


  4. 15 hours ago, Remy Lebeau said:

     

    COleDataSource is just a Microsoft C++ helper class that implements the IDataObject interface, which can be put on the clipboard using the OleSetClipboard() function.  In Delphi, you would have to implement the IDataObject interface manually (it is declared in the Winapi.Ole2 unit), or use a 3rd party implementation, such as from Melanders' Drag&Drop suite (probably via TDropEmptySource+TDataFormatAdapter).

    Thank you, you gave me a great case study 😊


  5. 17 hours ago, Remy Lebeau said:

    All the more reason to try the route I suggested.  Application A could send its file list to Application B, then B can immediately put CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS items on its local clipboard for each file, having each CFSTR_FILECONTENTS hold an IStream to access its file data.  Then, when the user pastes the clipboard somewhere (or an app reads the clipboard directly), the individual CFSTR_FILECONTENTS streams can/will be read from, which can then transfer the actual file data from machine A to B as needed.  You could even go as far as having A transfer the file data to B in the background while waiting for a paste to happen, caching the data locally on B, and when CFSTR_FILECONTENTS is read from it can read from the local cache if available, otherwise initiate/wait-for the transfer to finish (even provide the data while it is begin transferred).  When the clipboard gets cleared, the IStream's will be released, and their destructors can cancel any transfers in progress and delete any local caches as needed.

    it's not a walk in the park, if you were to do it in c++ it would be easier.
    With Delphi I can't find the interface wrappers or the structures I should be using.

     

     

    Ex In C++ 
     

    // Create an OLE data source on the heap
       COleDataSource* pData = new COleDataSource;
       // Get the currently selected data
       HGLOBAL hGlob = GlobalAlloc(GMEM_FIXED, 64);
       strcpy_s((char*)hGlob, 64, "Current selection\r\n");
       // For the appropriate data formats...
       pData->CacheGlobalData( CF_TEXT, hGlob );
       // The Clipboard now owns the allocated memory
       // and will delete this data object
       // when new data is put on the Clipboard
       pData->SetClipboard();

     In Delphi not Exist class COleDataSource  ( Or I haven't found it yet ) 

     

    COleDataSource has the virtual function OnRenderData that I might need.

     

     


  6. 11 hours ago, programmerdelphi2k said:

    @gioma

    dont forget: you need verify if the file really exists and then some way block another app to change/delete...

     

    the file does not exist on the filesystem at the time of the paste action because it has to be transferred from another PC.


  7. 37 minutes ago, Remy Lebeau said:

    Thanks for the reply.
    I had seen the first example and in fact I would like to try to derive the COleDataSource class, I just need to understand in which Delphi unit it is present!

     

    39 minutes ago, Remy Lebeau said:

    I'm sure they have, but it is very specialized work, so you are not likely to see it talked about publicly very much.

    Of course I imagined it, but a little something could also be shared ..


  8. 2 hours ago, programmerdelphi2k said:

    @gioma, I think you should avoid using Clipboard, even if it works in your project, for the simple fact that it is a neutral layer and used by any other application in your system. In this way, nothing guarantees that the information obtained will be the desired information. You know it!

     

    Now, as you are already communicating with the second (or any other) application on the network, then, I think the most sensible thing would be to approach this direction, that is, send the desired information through TCP/IP, UDP or similar communication ... etc...

     

    In this way, you can guarantee that your transmissions will be directed exclusively to your interested applications, that is, to everyone who makes use of this communication, it can be one, two, or as many as you wish.

     

    You could easily do this code without much impact on your current project, if you want, you could even create a small TCP/IP server using INDY or whatever to listen on a certain port, and thus receive all messages (information) desired. In this way, you can ensure that you receive the information sent by another application.

     

    Delphi can easily generate a DataSnap Server (ie the code) for you to add to your applications. Delphi has Tethering components, which you can easily add to a form, so almost no code is needed. Communication is carried out by TCP/IP and UDP protocols, in this way, you just need to place a Tethering Server component in the applications that will receive the information, and another Tethering Client in the application that will send the information, the rest is just using one or two events to receive the information. Very easy and without much complexity.

     

    here a great sample by Malcolm Groves : http://www.malcolmgroves.com/blog/?p=1891

    Hi, thanks for the reply.
    I already do, mine is a remote control software.
    Currently I can transfer a file from one PC to another via a file browser (which opens on the parent site).

    But now I need to implement the "copy-paste" so I need to interact with the system clipboard.

     

    2 hours ago, programmerdelphi2k said:

    @gioma  based on @Remy Lebeau text, I have test this code and works... but not guaratee if it's good for all...ok?

     

    
    // VCL tests
    ...
      private
        FClipboardListenerHandle: HWND;
        procedure ClipboardUpdateHandler(var Msg: TMessage); message WM_CLIPBOARDUPDATE;
    ...
    
    implementation
    
    {$R *.dfm}
    
    uses
      Winapi.ShellAPI,
      Winapi.ShlObj,
      Vcl.Clipbrd;
    
    { TForm1 }
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      if AddClipboardFormatListener(Handle) then; // ????
      //
      Memo1.Lines.Add('AddClipboardFormatListener: GetLastError = ' + GetLastError.ToString);
    end;
    
    procedure TForm1.FormDestroy(Sender: TObject);
    begin
      if RemoveClipboardFormatListener(Handle) then; /// ???
      //
      Memo1.Lines.Add('RemoveClipboardFormatListener: GetLastError = ' + GetLastError.ToString);
    end;
    
    procedure TForm1.ClipboardUpdateHandler(var Msg: TMessage);
    var
      LClipboardData : THandle;
      LGLobalLock    : Pointer;
      LFilename      : PWideChar;
      LFilenameBuffer: array [0 .. MAX_PATH] of WideChar;
      //
      cfShellIDList: UINT;
    begin
      if not IsClipboardFormatAvailable(CF_HDROP) then
        exit;
      //
      cfShellIDList := RegisterClipboardFormat(CFSTR_SHELLIDLIST);
      //
      if OpenClipboard(Handle) then  // opening the Clipboard...
        begin
          try
            LClipboardData := GetClipboardData(CF_HDROP); // some data?
            //
            if (LClipboardData > 0) then
              try
                LGLobalLock := GlobalLock(LClipboardData); // lock it...
                try
                  if (LGLobalLock <> nil) then
                    begin
                      DragQueryFileW(HDROP(LGLobalLock), 0, LFilenameBuffer, MAX_PATH); // catch the file/folder name
                      //
                      Memo1.Lines.Add('File name: ' + LFilenameBuffer);
                    end
                  else
                    Memo1.Lines.Add('LGLobalLock = nil');
                finally
                  GlobalUnlock(LClipboardData); // unlock it...
                end;
              except
                on E: Exception do
                  Memo1.Lines.Add('Exception: ' + E.Message);
              end
            else
              Memo1.Lines.Add('----- ClipboardData = 0 -----');
          finally
            CloseClipboard;
          end;
        end
      else
        Memo1.Lines.Add('OpenClipboard = false');
    end;

     

    Project1_mMQ8tZF0Zc.gif

     

    Thank you, it's an interesting example.

     

    Now I'm trying to use the COleDataSource class, overriding the OnRenderFileData method. It's still theory at the moment, but I'm looking for a way to make it work.
    Anyway, any ideas are always welcome!

     

    PS
    for example it would be interesting to know on which unit Delphi has the definition of these classes..


  9. 10 hours ago, Remy Lebeau said:

    That is the OLD way to monitor the clipboard.  Since Vista, the NEW way is using a Clipboard Format Listener instead, registered via AddClipboardFormatListener() and handling WM_CLIPBOARDUPDATE messages.

    Hi, yes I'm using this way to monitor the clipboard, I didn't specify it because my problem arises later.

     

    10 hours ago, Remy Lebeau said:

    Have you read Transferring Shell Objects with Drag-and-Drop and the Clipboard yet? Per Shell Clipboard Formats, you will likely want to implement the CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS formats.  That way, you can put descriptions of the files onto the clipboard, and when they are pasted then you can stream in the actual file data as needed.

    I've read this article, but I still can't get into it.
    Time is never an ally, so I was looking for an example to start with, to avoid too many empty tests, and also because the testing phase is not easy, as we are dealing with two applications on two different PCs communicating via sockets.
    My specific case is as follows:
    I have two applications, A and B, connected by a socket connection.
    Application A intercepts the modification of its clipboard and sends the event to application B.
    Here we have two cases:
    1 if it is a text, it copies it directly to the clipboard
    2 if it is a file, it copies the list to the clipboard.
    Up to point 1 there are, while I have difficulty understanding how to pass the list of files to PC B (or rather I can do this phase) and make sure that when I press "paste" (here is the real problem which I'm racking my brain over) the file list transfer begins and the system waits for the files to be transferred before completing the paste command.
    I can't find half an example of this on the net, I can't believe no one has ever done this before, maybe even in C, C++.

     

     


  10. 27 minutes ago, programmerdelphi2k said:

    I'm not an expert on Windows messages, but you would have to intercept the "WM_DRAWCLIPBOARD" message, to receive notification that MSExplorer intends to copy some object (file/folder/etc...).

    But first your app must be registered with a "Clipboard Viewer" ( SetClipboardViewer() ), and when you finish the app, do the "Un-Register" ( ChangeClipboardChain() )

    • try verify this message in your app:
      • procedure WMDrawClipboard(var Msg: TMessage); message WM_DRAWCLIPBOARD;
      • procedure WMChangeCBChain(var Msg: TMessage); message WM_CHANGECBCHAIN;

     

    NOTE: This does not guarantee that the file was actually copied, as you are only receiving the notification that something will be copied. The file may be large and the other application will need to check if the file "already exists on disk"

    Thanks for the reply.
    I already do this, in fact if I copy paste a text it works perfectly.
    The problem instead I have with the files because they are not yet available on the file system because they come from the other PC.
    I send the list of files but I would like it to start the transfer only when "paste" is pressed and then the "paste window" waits for the files to be completely transferred and therefore available.


  11. Hi,
    I'm making a program that sends files from PC A to PC B.
    When I copy a file on one PC I would like it to be available on the other PC's cliboard.
    What I can do is manipulate the clibboard by copying the paths of the files I intend to transfer, but then I have to intercept the "copy" command in order to start the transfer.
    I tried with hooks but no way.
    Do any of you know how I could do this? Or maybe you have a different better idea? Thank you.


  12. 44 minutes ago, programmerdelphi2k said:

    look into your "EXE / RES", search for "manifest" ... see if any "condition" specific to folders in use? => Notepad++ is good for that!

    image.thumb.png.8a87490e28e2663c573c3a18b4a845b8.png   image.thumb.png.be31370aa1463f7a00b1ff8a1835ea0b.png

     

    the settings appear to be correct:

     

    <asmv3:application>
        <asmv3:windowsSettings>
          <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
          <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
        </asmv3:windowsSettings>
      </asmv3:application>

     


  13. 8 minutes ago, programmerdelphi2k said:

    look, RAD 11.x use new IDE designer using "delphi" components (if I dont wronged... TControlList to create a menus), then, I have some bugs too! same that in FULLHD only, for example, if you try manipulate your "float-menus" for example drag'n'drop, many times ... sometimes, happens a infinity looping and you can the "menus..." rolling on screen... it's crazy... then, my tip it's "not redefine it, but re-adjust it manually ... save your desktop again... close IDE!  (IDE save re-save your desktop again each "exit"!

     

     

     

    The problem is that it won't let me do anything, because the menus changed size and that thing is not manually editable.

×