Jump to content

PeaShooter_OMO

Members
  • Content Count

    72
  • Joined

  • Last visited

Everything posted by PeaShooter_OMO

  1. 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?
  2. 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.
  3. @PeterBelow @DelphiUdIT I understand and edited my post.
  4. 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.
  5. What should be deleted? Your reply?
  6. @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.
  7. 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.
  8. 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
  9. 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.
  10. PeaShooter_OMO

    Delphi 12 Component Palette Panel Shift Issue

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

    SSL connection

    I am not sure why is there a rquirement to not have an accompanying DLL. Please will you explain.
  12. 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.
  13. 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
  14. 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.
  15. PeaShooter_OMO

    Clicking something in TEdgeBrowser

    Whatever you are looking for you will probably find by searching for Javascript examples
  16. 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;
  17. PeaShooter_OMO

    Clicking something in TEdgeBrowser

    As a messagebox or as the only content of the EdgeBrowser by removing the rest?
  18. 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.
  19. 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?
  20. PeaShooter_OMO

    Encryption (AES)

    Why is it difficult to implement? Or shall I rather say; what about it makes it difficult to implement?
  21. Pointers should not be avoided and I highly suggest programmers should learn to use them properly and embrace them. They can make life so much easier.
  22. PeaShooter_OMO

    Delphi 12 is available

    At home I am still on a very old version of Delphi. I hardly ever make money from Delphi privately and most utilities I create I give out for free to those I create it for. My best friend does make some money but not even enough to surpass the limitation of CE. He also is still on an old version of Delphi. There are only two reasons why I have not gone over to the CE and I reckon many might see them as lame reasons; 1. The limited Source Code. I constantly go into the source code to see what is being done and I alwys go into the source code the moment I come across some strange behaviour in my applications that I do not have an explanation for. I want access to source code. 2. The irritating thing of having to reinstall CE after a year and being forced to use the latest CE to do that with. Like most will testify to, reinstalling is a pain. I created a custom installer for my Delphi installation. It installs Delphi, copies all required 3rd party libraries and sets up multiple registry entries. So I just run it and sit back and as soon as it is finished I am ready to go without having to do any additional setup. It makes my life so easy but it is linked to the version of Delphi it is installing. Yes, I know its a lame excuse. But apart from that I believe CE to be quite valuable. Considering that we are part of an ecosystem that uses an IDE that by reason of its smaller community is being forced to be charged for to keep existing I would say that CE will help a lot. I have to pay for my lunch and I do not blame others that have to make a living too. Anybody that uses Delphi and complains about the price of it and at the same time complains about CE needs to remember that free hardly ever is completely free and time is money and quality takes time. That person would probably not use Delphi if they believed other IDEs/tools to be better in anyway so if you like it pay for it or use CE. We all know the issues with the versions we have and we all know it is expensive but most of us like using Delphi ( I assume) and I surely do not wan't to use another tool.
  23. I removed the standard Indy from Delphi 11. I used the Clean_Alexandria.cmd batch file and also went through all files and folders on my PC to remove any Indy*.bpl, dclIndy*.bpl, Id*.dcu, Id*.pas files that may exist. I removed all previous Library and Browsing Paths. I then downloaded Indy from the Git repository (Commit: b994412). I opened the project group for Delphi 11 (280) and changed each package's "Unit Output Directory" to (one for each, related to its functionality - System, Core, Protocols): ..\..\..\Delphi 11\DCU\System\$(Platform)\$(Config) or ..\..\..\Delphi 11\DCU\Core\$(Platform)\$(Config) or ..\..\..\Delphi 11\DCU\Protocols\$(Platform)\$(Config) I made sure to enable "Explicit Rebuild" for all packages. I made sure the DPK files did not get corrupted and that they looked the same as the originals after changing project options. I did also try with the {$IMPLICITBUILD OFF} directive. I then built and added Library paths, Browsing Paths and Debug DCU paths for Win32 and Win64 to Delph Options: Debug DCU: c:\<..........>\Delphi 11\DCU\System\$(Platform)\Debug c:\<..........>\Delphi 11\DCU\Core\$(Platform)\Debug c:\<..........>\Delphi 11\DCU\Protocols\$(Platform)\Debug Library: c:\<..........>\Delphi 11\DCU\System\$(Platform)\Release c:\<..........>\Delphi 11\DCU\Core\$(Platform)\Release c:\<..........>\Delphi 11\DCU\Protocols\$(Platform)\Release Browsing: c:\<..........>\Source\System c:\<..........>\Source\Core c:\<..........>\Source\Protocols I obviously copied all *.pas and *.inc files to the related Source folders I added to Browsing paths. I also copied all the *.res files to the related DCU folders I outputted the units to just for incase. When I create a blank project and add a IdTCPServer to the form and run it works fine. The moment I enable "Use Debug .DCUs" and try to build it gives the F2051 error: [dcc32 Fatal Error] Project11.dpr(5): F2051 Unit IdThread was compiled with a different version of IdGlobal.IdDisposeAndNil I am sure I am missing something here. I have upgraded Indy many times before in Delphi XE3 but this one stumps me.
  24. Point #1 Before I started with the upgrade I seached for all Indy related files and and I searched all my drives. Before each Indy build I would also go and delete all DCUs, DCPs and BPLs. Point #2 You made me think about what was happening so this weekend I realized that because I use a Build Group and each project in the Project group first builds the Debug then the Release I realized that because after each build per $(Config) the DCPs and BPLs are replaced. I am not sure which carries the signatures for the units. So obviously what would happen is that for instance IndySystem's DEBUG gets build then its RELEASE. So when it is IndyCore's turn its DEBUG gets build but references IndySystem's RELEASE DCP/BPL. Thats when the problem starts. So now I first finish building all the DEBUGS for all the projects first then I build the RELEASES for them and it works perfectly. Thanks for your help and thanks for injecting some perspective here to guide me to the answer.
×