Jump to content

DelphiUdIT

Members
  • Content Count

    774
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by DelphiUdIT

  1. In order for everything to compile correctly, there are two changes to make: 1) In the "IdRegisterOpenSSL.pas" file it is necessary to insert the following file "IdDsnCoreResourceStrings" among the uses because it is inside it that the string "RSRegIndyIOHandlers" is defined, which is necessary to register the graphic components. 2) The "IdRegisterCoolOpenSSL.dcr" file is missing .... just copy it (and then rename obviously) from the "IdRegisterCool.dcr" file). I tried to install with the changes proposed by "@esegece-com" and appropriately modifying the original "*register*" files to also activate the changes at design time level and everything worked perfectly. A project developed both in design and code is running correctly. Do not use with the original Athens 12.1 Indy distribution.
  2. DelphiUdIT

    C++ to Delphi conversion problem

    I'm not expert on C++, but you must expose all members of your "struct", and some of them are not integral or something equivalent to Delphi like "vector<...>". See this: https://blogs.embarcadero.com/vector-containers-for-delphi/ How do you translate the "struct" and ALL the members in Delphi ? There are few information (or better none information) to help you, but I think that the problems are the "translation" the structs from c++ and records in Delphi. After you resolve this you must go on and try to implement a procedure .... Bye
  3. DelphiUdIT

    Delphi 12 error when closing the ide

    I use them (almost more then 10 years) and I never had any issue with. And in every project there are one or more component of Jedi (visual and not visual). I always use the github version https://github.com/project-jedi
  4. DelphiUdIT

    Delphi 12.1 TCurlHTTPClient

    Take from "System.Curl"
  5. DelphiUdIT

    Indy documentation

    There is an help in Rad Studio, It's old but some it is still valid.
  6. DelphiUdIT

    PyInstaller

    But you don't need it, it was only a demonstration, I think from your last post that you are already resolved. Bye
  7. DelphiUdIT

    PyInstaller

    I attached a zip file in the previous post : https://en.delphipraxis.net/applications/core/interface/file/attachment.php?id=11265 Inside there is all, two Delphi projects and a Python script.
  8. DelphiUdIT

    PyInstaller

    Let's explain ... I'm not an expert about Python, but i work on some P4D projects and I see some issues (they are not really issues, but you cannot do some things if those happens). Look for script TEST.PY and Delphi lib pyTRYSF.pyd in the attached example. First of all: instead to do "onefile", do the standard distribution that pyinstaller do ... try only (from the pyinstaller environment): pyinstaller test.py This will create the folders that containing the executable and all the necessary files (including your .pyd library compiled with Delphi): dist\test\_internal Inside "dist\test" ther will be an executable (test.exe) and in the subfolder "_internal" should be all necessary for running the exe, INCLUDED pyTRYSF.pyd) !!!! For running any delphi library with Python is necessary to link the Pythonxxx.dll main engine at runtime. This mean that this engine should be found. When you run a python script that import a Delphi dll normally (eg. after you installed Python in Windows) your module can link the standard pythonxxx.dll library installed and is the same that the python "shell" call. If you are running the test.exe program created by pyinstaller, the pythonxxx.dll library is not the standard library, but is the DLL that is inside the "_internal" subfolder, where the pyd module is too. This "_internal\pythonxxx.dll" should be link at runtime by Delphi dll (pyTRYSF.pyd in the example). If you don't link this at runtime, you will never be able to execute your "pyd". In the example attached there is an example how I modified the link engine procedure to search the correct lib ... it works without changes with installed python engine or with pyinstaller (but no with --onefile parameters). Why the --onefiles parameters doesn't works ? 2 are the issues: 1) The pyd is not included by pyinstaller in the executable (with --onefile). 2) The executable unzip the same files like "_internal" in a temporary directory. This lead the impossibility to link the pythonxxx.dll because when the test.exe is executed the execution path is the ".\" of the test.exe an not the temporary directory. There are no chance for Delphi pyd module to link the correct pythonxxx.dll. May be the P4D guru can help in this. Bye N.B.: the example works only with Python 3.12 by now. DelphiDLLforPython.zip
  9. DelphiUdIT

    Problems closing IDE

    I have a lot of components installed and had no issue (except for know incompatibility beetwen "new Indy from repo" and "Embarcadero RAD Server Edge Components"). I don't usually use plugins, and I found the same like others told, Parnassus Debugger plugin emit every time some AV, either in debugger sessions (not often) or when closing Rad Studio with open project ( issue from old portal is RSP-43335, issue from new portal RSS-1243). I simply use TaskManager ('analyzes waiting chain' or similar) and Process Explorer to find the module (apparently responsible).
  10. DelphiUdIT

    Is jedimath still maintained?

    It seems that, according to the limited documentation, they never left the "alpha" phase (year 2005).
  11. DelphiUdIT

    How to import Type Library for Managed Code DLLs

    To view COM components from IDE, your assembly should be compiled for 32 BIT explicitly (so you must have two dll register, 1 for 32 bit and one for 64 bit if you produce 64 exe). Other way is to import it using the bin64\tlibimp,exe or /bin/tlibimp.exe utility (produce the _tlb pas file). If you have only the 64 bit dll, you can use it at runtime. Example: "C:\Program Files (x86)\Embarcadero\Studio\23.0\bin64\tlibimp.exe" -Ha+ -Hs+ -Hr+ -Ya- -O+ -R+ -W+ -Wc+ -P+ "C:\Windows\System32\Speech\Common\sapi.dll" Import SAPI COM from Windows system and generate _TLB PAS file (also call wrapper).
  12. DelphiUdIT

    Lib OpenSSL Android 1.1.1n

    To @Remy Lebeau if you want add this library (OpenSSL Android 1.1.1n) to experimental binary directory on Indy repo. https://cloud.dyn-o-saur.com/Android lib 1.1.1n.zip I try this version on Android 11 phone (Arm 64 bit), of course with Indy and new SSL IO Handler (PR299 archive). Bye
  13. DelphiUdIT

    SMTP on Android

    He said to use 1.0.2s version. This means that the library should be that version. I only suggest to load on the default library path and see what happens. In the past time I have some issues with some versions of Android with .so libs loaded around the systems (in Shared Doc, External Doc, etc...). So I always loaded them in the default library paths.
  14. DelphiUdIT

    SMTP on Android

    I'm using to deploy the .so files in "library\lib\arm64-v8a\" and I don't have to do nothing at startup, no loads or other ... Try to put only: ShowMessage(OpenSSLVersion()); in a Form Create event and see if the version will show.
  15. DelphiUdIT

    Prompting user to update a Windows Store app

    This may help: https://learn.microsoft.com/en-us/windows/package-manager/winget/upgrade
  16. DelphiUdIT

    Looking for info on the TIPSocket class

    To include Socket components, you must add component through menu "Component/Install Packages" and search at bin directory (like in the images). The socket package is deprecated, but it is still present.
  17. Nothing ... I was wrong
  18. New offline helps for Rad Studio 12.1 Athens are published. https://docs.embarcadero.com/products/rad_studio/
  19. DelphiUdIT

    Localization of VCL Dialogs

    I use simply this, limited to common standard system strings, of course this is a skeleton ... form the Main program you can use it in this way: TTraduzione.ChangeValues('IT'); unit uTraduzione; interface uses WinApi.Windows, System.SysUtils, Vcl.Consts; Type TTraduzione = Class public class procedure SetResourceString(const xOldResourceString: PResStringRec; const xValueChanged: PChar); public class procedure ChangeValues(Lingua: string = ''); End; implementation class procedure TTraduzione.SetResourceString(const xOldResourceString: PResStringRec; const xValueChanged: PChar); var POldProtect: DWORD; PLostProtect: DWORD; begin VirtualProtect(xOldResourceString, SizeOf(xOldResourceString^), PAGE_READWRITE, @POldProtect); xOldResourceString^.Identifier := NativeUInt(xValueChanged); VirtualProtect(xOldResourceString, SizeOf(xOldResourceString^), POldProtect, @PLostProtect); end; class procedure TTraduzione.ChangeValues(Lingua: string = ''); begin if Lingua = 'IT' then begin //Carica la lingua italiana SetResourceString(@SMsgDlgYes, '&Si'); SetResourceString(@SMsgDlgWarning,'Attenzione'); SetResourceString(@SMsgDlgError, 'Errore'); SetResourceString(@SMsgDlgInformation, 'Informazione'); SetResourceString(@SMsgDlgConfirm , 'Conferma'); SetResourceString(@SMsgDlgNo , '&No'); SetResourceString(@SMsgDlgOK , 'OK'); SetResourceString(@SMsgDlgCancel , 'Annulla'); SetResourceString(@SMsgDlgHelp , '&Aiuto'); SetResourceString(@SMsgDlgHelpHelp , 'Aiuto'); SetResourceString(@SMsgDlgHelpNone , 'Nessun aiuto disponibile'); SetResourceString(@SMsgDlgAbort , '&Termina'); SetResourceString(@SMsgDlgRetry , '&Riprova'); SetResourceString(@SMsgDlgIgnore , '&Ignora'); SetResourceString(@SMsgDlgAll , '&Tutto'); SetResourceString(@SMsgDlgNoToAll , 'N&o a Tutto'); SetResourceString(@SMsgDlgYesToAll , 'Si a &Tutto'); SetResourceString(@SMsgDlgClose , '&Chiudi'); end else if Lingua = 'EN' then begin //Carica la lingua inglese SetResourceString(@SMsgDlgYes, '&Yes'); SetResourceString(@SMsgDlgWarning,'Warning'); SetResourceString(@SMsgDlgError, 'Error'); SetResourceString(@SMsgDlgInformation, 'Information'); SetResourceString(@SMsgDlgConfirm , 'Confirm'); SetResourceString(@SMsgDlgNo , '&No'); SetResourceString(@SMsgDlgOK , 'OK'); SetResourceString(@SMsgDlgCancel , 'Cancel'); SetResourceString(@SMsgDlgHelp , '&Help'); SetResourceString(@SMsgDlgHelpHelp , 'Help'); SetResourceString(@SMsgDlgHelpNone , 'No Help Available'); SetResourceString(@SMsgDlgAbort , '&Abort'); SetResourceString(@SMsgDlgRetry , '&Retry'); SetResourceString(@SMsgDlgIgnore , '&Ignore'); SetResourceString(@SMsgDlgAll , '&All'); SetResourceString(@SMsgDlgNoToAll , 'N&o to All'); SetResourceString(@SMsgDlgYesToAll , 'Yes to &All'); SetResourceString(@SMsgDlgClose , '&Close'); end else if Lingua = 'ES' then begin //Carica la lingua spagnola SetResourceString(@SMsgDlgYes, '&Si'); SetResourceString(@SMsgDlgWarning,'Advertencia'); SetResourceString(@SMsgDlgError, 'Error'); SetResourceString(@SMsgDlgInformation, 'Información'); SetResourceString(@SMsgDlgConfirm , 'Confirmar'); SetResourceString(@SMsgDlgNo , '&No'); SetResourceString(@SMsgDlgOK , 'OK'); SetResourceString(@SMsgDlgCancel , 'Cancelar'); SetResourceString(@SMsgDlgHelp , '&Ayuda'); SetResourceString(@SMsgDlgHelpHelp , 'Ayuda'); SetResourceString(@SMsgDlgHelpNone , 'No hay ayuda disponible'); SetResourceString(@SMsgDlgAbort , '&Termina'); SetResourceString(@SMsgDlgRetry , 'Intentar &otra vez'); SetResourceString(@SMsgDlgIgnore , '&Ignorar'); SetResourceString(@SMsgDlgAll , '&Todos'); SetResourceString(@SMsgDlgNoToAll , 'N&o a todo'); SetResourceString(@SMsgDlgYesToAll , 'S&i a todo'); SetResourceString(@SMsgDlgClose , '&Cerrar'); end else begin .................... .................... .................... end; end;
  20. DelphiUdIT

    XX3_64Bits -hash really flies

    https://blogs.embarcadero.com/powerful-advanced-hashing-library-for-delphi-windows-development/ XXHash32 and XXHash64 are there (github link inside), but not optimizing I think. I looked around some DLL AVX2 optimized with Delphi wrapper, but I don't remember where.
  21. I use nested methods when I have activities to carry out exclusively in that specific "section" of the program This also allows me to remind myself in the future that that type of operation only happens there. And the variables used are mostly just passed as parameters. Then it will be so simple and painless to eventually convert the nested method into a public/private method if needed.
  22. DelphiUdIT

    Slow rendering with SKIA on Windows

    This is mine, same project of @vfbb but with 2 graphics surface from the same PC (always with vulkan enable): Intel Nvidia Intel: Intel(R) Iris(R) Xe Graphics Nvidia: NVIDIA GeForce RTX 3070 Ti Laptop GPU P.S.: Vulkan version 1.3.277
  23. In Windows you can use the function " EmptyWorkingSet(GetCurrentProcess) " (from WinAPI.PsAPI) to release all memory to OS. I use it on my application when the memory used is over 50% of all system memory (this help also to reduce the effects of fragmentation). My applications use lot of images, near 2000 raw buffers / second (form some KB to some MB) and fragmentation is high. Every 4 / 5 days I look (from logs) that the application use that function. Normally the application stay on near one year, actively working 10 hours per day. You should look for equivalent function in Linux (I'm quite sure that should exists). Bye
  24. DelphiUdIT

    The function of EmptyWorkingSet

    You look this post with result ? There are simple memory non release to OS (paged, not paged, virtual, not virtual, ghost, not ghost, imaginary, not imaginary ...) and the acts like "cache". This memory will be releases directly by OS if it's needed. I simply forced that (there is not only EmptyWorkingSet APi but others that do the same) when the size of the WorkingSet is too high. That's all, really simple. No side effects (except for the first "round" of application where I have latency, OF COURSE). AND EmptyWorkingSet doesn't works (I means that the results are not constant) when there are leaks: I had done some tests with memory leaks, and the base memory, as expected, increased every time that a leak was generated. You can see it very well and is very clear with EmptyWorkingSet. EDIT: this is the only way I know, but like always I might miss something of course, to view a leaks "on the line" that you have, when using third-party libraries. If you don't have leaks, after three years (the "ancient" report with live application that I have) the base memory (simply measured after call the API) is exactly the same measured with byte precision. This is possible, I agreed with you: but until the next refactoring the things stay in this way. I promise that will do some tests to view if the conclusions are wrong, and report here that.
×