Jump to content

GabrielMoraru

Members
  • Content Count

    96
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by GabrielMoraru

  1. GabrielMoraru

    Can not crate a new project

    Delete the string grid OR start a new Delphi project without any changes to it. Sometimes when Delphi acts strange it is enough to restart the IDE. Since Windows 10, if a PC restart is pending because of Windows updates, Delphi will act strange. Restart the whole PC. _______ But indeed... "Console host" and "Printer" is strange... Should not be a subprocess of Delphi. PC restart!
  2. GabrielMoraru

    IDE keyboard shortcut lost

    DDevExt has a nice feature called "Ctrl+Alt+Up/Down to move line". I use it a lot! (If you don't know it you don't know what you are missing 🙂 ) The problem is that sometimes Delphi forgets about this shortcut (nothing happens when I press the keys) so I need to open this settings panel and close it back, in order to reactivate the shortcut. Sometimes it happens after IDE restart, sometimes it just happens while the IDE is running. Seems pretty random. Once deactivated, it never comes back (by itself). Anyone has any idea what causes this and how to fix it?
  3. Good luck obtaining a stable unique ID (hardware fingerprint) on Windows. 🙂
  4. That discussion was in 2022. I wonder how the prices are now, with the new Trumsident (and his musky "son").
  5. GabrielMoraru

    12.3 or 13/14 as next?

    Agree. We do need a roadmap....
  6. GabrielMoraru

    Delphi TOIOBE index lifted in May 2022?

    Finally the guy from Tiobe mentions the word Delphi - but together with the word "dinosaurs".
  7. I have massive issues with this code when the CDN (cloudflare) is on. The error is: If I change to [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2] I get: I use "openssl-1.0.2u-i386-win32.zip". Delphi 11.3 (with its current Indy version 10.6.2). If I deactivate CDN, it works. I see a similar BUT different thread here: The difference: 1. My code works (without CDN) 2. That thread does not mention the CDN. var Response: string; HTTPClient: TIdHTTP; JsonResponse: TJSONObject; DataObject: TJSONObject; JsonRequest: TStringStream; SSLHandler: TIdSSLIOHandlerSocketOpenSSL; begin ServerResp.LicenseActive:= FALSE; CheckedToday:= TRUE; Result := FALSE; HTTPClient := NIL; SSLHandler := NIL; JsonRequest := NIL; TRY // Configure SSL/TLS IdOpenSSLSetLibPath(AppData.SysDir); // the folder where libeay32.dll can be found SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); SSLHandler.OnStatusInfo := StatusInfo; SSLHandler.SSLOptions.Method := sslvTLSv1_2; //sslvTLSv1_2; SSLHandler.SSLOptions.SSLVersions := [sslvTLSv1_2]; // [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]; // Can I add sslvTLSv1_3 here? No. Not supported by Indy. //SSLHandler.SSLOptions.CipherList := 'DEFAULT'; // Optionally, set a cipher list to ensure compatibility with Cloudflare SSLHandler.SSLOptions.CipherList := 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384'; // Or use specific modern ciphers SSLHandler.SSLOptions.Mode := sslmClient; SSLHandler.SSLOptions.VerifyDepth := 2; // !!!!!!!! // Temporary, for testing only SSLHandler.SSLOptions.VerifyMode := []; HTTPClient := TIdHTTP.Create(nil); HTTPClient.IOHandler := SSLHandler; HTTPClient.Request.ContentType := 'application/json'; HTTPClient.Request.Accept := 'application/json'; // Prepare JSON request JsonRequest := TStringStream.Create(Format('{"activation_token": "%s", "user_id": "%s"}', [aKey, UserID]), TEncoding.UTF8); if Assigned(FStatusChanged) then FStatusChanged(Self, 'SSL versions: ' + LogSSLVersion(SSLHandler.SSLOptions.SSLVersions)); try // Send POST request Assert(URL <> ''); Response := HTTPClient.Post(URL, JsonRequest); except on E: Exception do begin if Assigned(FStatusChanged) then FStatusChanged(Self, 'Error during server request: ' + E.Message); Exit; end; end; // Parse JSON response JsonResponse := TJSONObject.ParseJSONValue(Response) as TJSONObject; if not Assigned(JsonResponse) then begin if Assigned(FStatusChanged) then FStatusChanged(Self, 'Invalid server response format. Unable to parse JSON.'); Exit; end; try if not JsonResponse.GetValue<Boolean>('success', False) then begin VAR s:= JsonResponse.GetValue<string>('message', '?'); if Assigned(FStatusChanged) then FStatusChanged(Self, s); // User not found Exit; end; // Extract data object from response DataObject := JsonResponse.GetValue<TJSONObject>('data'); if not Assigned(DataObject) then begin if Assigned(FStatusChanged) then FStatusChanged(Self, 'No data object found in server response.'); Exit; end;
  8. GabrielMoraru

    "SSL routines:ssl3_read_bytes:tlsv1 alert internal" error when CDN active

    For the moment it works with TNetHTTPClient. But I still have both versions of the code. I will try also Indy with proper "useragent" string. ____ Update: Nope. Still does not work.
  9. GabrielMoraru

    "SSL routines:ssl3_read_bytes:tlsv1 alert internal" error when CDN active

    "its" 🙂 This means the Indy distributed with Delphi. So, I have Indy 10.6.2.
  10. > but this one line never showed up as an error at this point. I think this is what I didn't understood. So, this hidden line of code had an error but the compiler did not show it in the "Messages" as an error? I guess this is actually a linker error.... Right? __________ Strange. I had a similar problem but in my case the error was TOTALLY different. It is true that the test I have done was on Android. Mysterious are compiler's ways. 🙂
  11. There is something hidden in that cryptic message 🙂 I tried with an empty FMX app (0 code) and it works.
  12. FmxMsgBox.dpr is the current project. Really small. But it uses two packages (mine).
  13. So, I don't get what was the problem in the end. I don't use Spring4D.
  14. GabrielMoraru

    Guidance on FreeAndNil for Delphi noob

    My "3" cents: 1. FreeAndNil will definitively help you if you have stale pointers. 2. FreeAndNil costs only few more CPU cycles compared to Free(). 3. Some people with big mouth 🙂 suggested that FreeAndNil could be bad (somehow magically it will break your code), BUT nobody was able to post a piece of compilable code to prove it 🙂 . Until they do, they remain "big mouth" 🙂 . [Yes, this is a challenge] But, yes, don't design your code architecture around it. _ That being said, since it is so cheap to use it and might bring benefits, I do use it. PS: There were cases where it really helped. For example I had problems with a "use after free" in the ccrExif library. They were using an object after free. Replacing all .Free with FreeAndNil "magically" solved the "mystery".
  15. GabrielMoraru

    Guidance on FreeAndNil for Delphi noob

    Where the hell is the link to that video. I wanted for over an year now to see that video. It was never released! Google does not know such video: https://www.google.com/search?client=firefox-b-d&amp;q=free+and+nil+the+great+debate
  16. GabrielMoraru

    Looking for a localization tool

    When Google Translate API was released, I created a library that was supposed to automatically translate all text strings in the GUI to Google Translate for true automatic translation. The thing with the API was never implemented BUT the library works for manual translations (the human needs to do the translation). It even has a small tool to collect the text line by line to easily send it to Google Translate (or better DeepL). https://GabrielMoraru.com/my-delphi-code/delphi-libraries/delphi-rtti-based-automatic-language-translator-engine/
  17. GabrielMoraru

    I refactor your old code for free!

    Hi there I started my own Delphi YouTube channel and I want to create more content. Therefore, I came up with this idea. Let me know... O:-)
  18. GabrielMoraru

    Application won't start

    It is one of these: you swallow a critical exception, or you have an unhandled exception, or most likely, you overwrite your own memory (your stack trace should give you some clues) For 1: see if you have empty try/except blocks. If you have, you should be ashamed of yourself 🙂 🙂 🙂 For 2: check the IDE options, debugger section. For 3: enable range checking and overflow checking. 3b. Show your stack trace here. Is it corrupted? I recommend from al my heart madShi (EurekaLog would do it also, but I find it very buggy). _ Is your Debug mode properly configured? Can you debug into the program?
  19. GabrielMoraru

    Delphi TOIOBE index lifted in May 2022?

    Congratulations to Delphi and its community.
  20. Have you even tried to debug? 0. The file is present in Github. It was never missing: https://github.com/GabrielOnDelphi/Delphi-LightSaber/blob/main/ccCore.pas Which leads us to: 1. The main file of the project says that Vcl2Fmx requires the LightSaber library. Have you even downloaded the LightSaber library? Which leads us to: 2. You need to check your local files. Have you even tried to find it in your computer? If the Explorer returns a result it means that you have it. Which leads to: 3. Are your Paths set correctly? The Vcl2Fmx project needs to find the LightSaber library.
  21. The LightSaber goes through a massive change right now, because I want to make it FMX compatible. For 24h some files were missing indeed. Now everything should be fine. I think you have the old code. Please pull the new code. Let me know if something is still missing. _____________________________ PS: still ccCore.pas should not be missing. that the most important file from the whole library. _____________________________ TAppData is a replacement for TApplicationData. Does a few extra cool things compared to TApplication, such as: embedded support for "AppData" folder and INI files (the ini files knows how to save themselves to the AppData folder), support to save GUI state to disk and reload it when the next time the app starts (don't abuse it 🙂 ), support for exe version number, exe self-restart, support for self-translating GUI, support for Internet updater, logging system, app installer/uninstaller "RunningFirstTime" in this computer etc etc etc etc etc etc etc etc etc etc etc etc You have a demo in "Demo\Template App\TemplateApp.dpr" that shows all those capabilities of TAppData. _____________________________ At this point I make no guaranty about any file marked with "FMX". Fmx support at this point is highly experimental (though the Vcl2FMX compiles under FMX). _____________________________ I released another update for VCL2FMX. The code had a massive grudge against Unicode. I guess it was written in a Delphi before unicode? I think I made a mistake in updating that code. I should have written that from zero! Now it works. At least on one of my old VCL programs that I use for testing There was also a massive mem leak (the fastmm report log was 1.4MB! I cut it down to few KB).
  22. Update: the old convertor (9 years old) was brought up to date. This is the major update! It has: True unicode support! Fixed bugs Better file handling Smaller code English instead of spanish There is plenty of room for optimizations. I will try to update it as necessary. (Precompiled exe file available) PS: does anyone know how to reduce its size? It is 10MB!
  23. GabrielMoraru

    Converting simple VCL form to FMX

    I have a review of the the existing convertors, including the AI here: https://gabrielmoraru.com/converting-vcl-code-to-fmx/
  24. GabrielMoraru

    VCL resizeable and moveable label

    Nice. Since the user updates the position of the label at runtime, does it remember its position when the program restarts?
  25. I have done some tests using 4 different methods. None is sufficient. I will have to bring the the FMX to VCL converter up to date. I am working on it (I will put it in my git repository).
×