Jump to content

PeaShooter_OMO

Members
  • Content Count

    76
  • Joined

  • Last visited

Everything posted by PeaShooter_OMO

  1. @Darian Miller In times like these I just use pointers. Not sure whether that will affect the API interaction though. PRecordB = ^TRecordB; PRecordC = ^TRecordC; TRecordA = record Field1 : Integer; Field2 : PRecordB; Field3 : string; TopX : PRecordC; end; TRecordB = record Field4 : Integer; Field5 : TRecordA; end; TRecordC = record Items : TArray<TRecordA>; end;
  2. @o815 TAdvStringGrid does not have any functionality to satisfy your request, at least not as far as I can remember. You will have to iterate font sizes to do that. You can have a look at Canvas.TextHeight Canvas.TextWidth Canvas.TextExtent
  3. PeaShooter_OMO

    Set form in read only mode

    Another thing to consider is the visual aspect. When you disable a single control it may have a change in its visual representation as is the case with a button or an edit box that goes gray/grey and for good reason because that gives an indication to the user that it has been disabled. If you want that level of indication then you will have to disable each visually relevant control by itself. Disabling a parent container control does not affect the child controls visually. Disabling a few controls are easy and just a few lines but if you have many then you can loop through them and disable them that way. Have a look at the Controls and ControlCount properties of the parent containers (Form, Panel, TabSheet, GroupBox).
  4. PeaShooter_OMO

    TEdgeBrowser how to clear the cache

    I use TEdgeBrowser and it creates a sub-folder in the folder where my executable is outputted to. It is called <name of executable>.exe.WebView2 Many folders in it seem to be related to "Cache" Do you have such a folder?
  5. type TMyRec = record Int : Integer; Str : String; end; PMyRec = ^TMyRec; var LPointer : Pointer; begin New(PMyRec(LPointer)); PMyRec(LPointer)^.Int := 200; PMyRec(LPointer)^.Str := 'Blah'; Dispose(PMyRec(LPointer)); end; I do not know why this approach bothers me but for some reason it does. I am casting a Pointer to a PMyRec to use it with New() and Dispose(). I do not get a memory leak from this so I am assuming it will be operating correctly. Am I right? Edit: I understand that typed pointers are to be used with New() and Dispose(). This is just an experiment into the working of the memory around this and also New() and Dispose(). That's all.
  6. @PeterBelow @DelphiUdIT I understand and edited my post.
  7. Good day I have a server service which I originally created using Indy. I am now stuck with an issue which I am struggling to resolve. We have a deadline and that server service needs to be rolled out so I decided that while my Indy issue is being looked at I will see what alternatives are available and how they perform. The server I developed can sometimes accept hundreds of connections in a minute and files are exchanged between the server and the clients. There also exist occasions where another of the same server type will connect to this one and hundreds or even sometimes thousands of files maybe interchanged between them in a single session. I believe threads are crucial in such a situation and I was wondering how ICS will be able to perform in this sutation and aspecially with threads. I have read posts and comments about the differences between Indy and ICS. For example in this one long ago, ICS: Thread or not and in this one, ICS or Indy for a new project Francois notes that the developer has the freedom to use threads with ICS if he pleases and from what I have seen ICS has made provisions for the use of threads. But this post Stable Communication between ICS TSslWSocket and TSslWSocketServer and aspecially this comment from Angus (Comment) made me wonder whether threads are even a good idea with ICS. I will agree that that post's original developer's situtaion might not be known well enough to be able to make the assumption that threads are not a good way to work with ICS so I will rather ask and find out. Assuming threading is done correctly and also apart from the usual comment of "Most of the time you don't need threads in ICS, look how nicely my stuff works without it" and of course Angus' comment I would like to ask; Honestly now, can ICS work as expected within a multi-threaded environment closely built around ICS's framework? Second question... Can you use the Send method of ICS's Socket component from outside the original thread that the component was attached to without it bombing out somewhere down the line. In other words is it thread-safe to do so? Thank you for your input.
  8. What should be deleted? Your reply?
  9. @Kas Ob. If you look at the replies of that Gitter post you will see that the issue is actually not SSL/TLS. I did submit a demo app and code to that Gitter post which demonstrates the issue.
  10. Indeed I understand that even though connections are separated by means of sockets one would still be able to look at the incoming data across them as sort of "sequential" in nature and I assume in general one would be able to process that data similarly but these servers don't just do that the whole day. They also look at other processes which also include FTP and disk access along with DB access and then need to create new data and send it between them whenever required. The whole cycle is a bit time critical and in the very least I would expect the listening Server side to be in its own thread and perhaps hand off some major work to another thread, even socket access. Obviously Indy's server side does the thread per connection automatically and I might well be overthinking this when looking at ICS but the question I asked above about Sending from another thread was the very first thing I was thinking about. You see, I created a re-usable TCP framework which is used in different projects at our company including the above Server service and I want to adopt an approach that can be used in general by most if not all those projects. I also need my applications to be able to send network data to the other side at any point and from any thread. If ICS does not work well with that any thread sending then sure, I could transfer the data to be sent to the thread owning the socket. No problem. Now that I think of it, I wonder if that is not perhaps the reason for my issue with the current Indy implementation.... maybe Indy also does not like that I do that. Maybe @Remy Lebeau would be able to provide some insight regarding that. My research is to find solutions which I might have to consider in future.
  11. It is the post on the Indy Gitter Chat Room which you are currently looking at. I am researching other libraries while that one simmers in the background. My time might just run out and I need to be prepared. The post on Gitter
  12. PeaShooter_OMO

    Delphi 12 Component Palette Panel Shift Issue

    Do you have different Desktops setup? I have and I have found that sometimes my Object Inspector's Column (SplitPos) width changes because of the switching between the Debug Layout and my own custom desktop when I "Run" a program. The .DST files stijnsanders referred to in "c:\Users\<user>\AppData\Roaming\Embarcadero\BDS\22.0\" contains the layout of the desktops (adjust version number of folder as needed). The default ones as well as custom ones. I then go into each of them and make sure the relevant properties of the Object Inspector is set the same across all the .DST files uncluding the Debug Layout. I suggest that you look to see to if the Component Palette has properties in those files and set them the same across the board. Make sure to consider all relevant properties. This approach works for me for the Object Inspector but your situation might differ.
  13. PeaShooter_OMO

    Delphi 12 Component Palette Panel Shift Issue

    Please uninstall (not disable) CnPack temporarily and see if it still occurs
  14. PeaShooter_OMO

    SSL connection

    I am not sure why is there a rquirement to not have an accompanying DLL. Please will you explain.
  15. PeaShooter_OMO

    SSL connection

    You don't need to set Method. Just use SSLVersions SSLVersions sets Method automatically so you setting Method is not required at all.
  16. PeaShooter_OMO

    SSL connection

    I have not heard of a way without them. I might be wrong though Just place the DLLs with your executable
  17. What are the output directories for that package? There is an answer on Stack Overflow that I believe is a good way of looking at the problem: Can't load package %s error while installing a package It basically employs SysInternal's Process Monitor to see where the IDE is looking for that package. This gives you an idea of of where the IDE thinks the package should be compared to where you are actually putting it.
  18. PeaShooter_OMO

    Clicking something in TEdgeBrowser

    Whatever you are looking for you will probably find by searching for Javascript examples
  19. PeaShooter_OMO

    Clicking something in TEdgeBrowser

    This should give you an idea type TForm3 = class(TForm) EdgeBrowser: TEdgeBrowser; Button1: TButton; procedure Button1Click(Sender: TObject); procedure EdgeBrowserWebMessageReceived(Sender: TCustomEdgeBrowser; Args: TWebMessageReceivedEventArgs); procedure EdgeBrowserNavigationCompleted(Sender: TCustomEdgeBrowser; IsSuccess: Boolean; WebErrorStatus: TOleEnum); private public end; var Form3: TForm3; implementation {$R *.dfm} procedure TForm3.Button1Click(Sender: TObject); begin EdgeBrowser.Navigate('https://www.google.com'); end; procedure TForm3.EdgeBrowserNavigationCompleted(Sender: TCustomEdgeBrowser; IsSuccess: Boolean; WebErrorStatus: TOleEnum); begin EdgeBrowser.ExecuteScript('window.addEventListener("click",function(e) {' + ' e = e || window.event;' + ' var target = e.target || e.srcElement;' + ' var text = target.textContent || target.innerText;' + ' window.chrome.webview.postMessage(target.outerHTML);' + ' }, false);'); end; procedure TForm3.EdgeBrowserWebMessageReceived(Sender: TCustomEdgeBrowser; Args: TWebMessageReceivedEventArgs); var LMsg : PWideChar; begin Args.ArgsInterface.TryGetWebMessageAsString(LMsg); ShowMessage(LMsg); end;
  20. PeaShooter_OMO

    Clicking something in TEdgeBrowser

    As a messagebox or as the only content of the EdgeBrowser by removing the rest?
  21. PeaShooter_OMO

    Clicking something in TEdgeBrowser

    It is possible to detect user clicks via a combination of the TEdgeBrowser's OnWebMessageReceived event and its ExecuteScript method along with Javascript but because of your last sentence I am unsure of what you actually want and for that one FPiette's suggestion is good.
  22. PeaShooter_OMO

    Is there any edit/memo which allows multiselect?

    How would copy and paste work? I suppose it would only copy the selected text but how would it look like after pasting? Space separated?
  23. PeaShooter_OMO

    Encryption (AES)

    Why is it difficult to implement? Or shall I rather say; what about it makes it difficult to implement?
×