Jump to content

chkaufmann

Members
  • Content Count

    108
  • Joined

  • Last visited

Everything posted by chkaufmann

  1. Hi, on my computer I have Kaspersky install by default and I cannot change that. I cannot even change any of the settigs, it's all under control of the system administrators. They already added my major application (EXE file) as exception under "Trusted applications" but I still have the feeling it takes forever after compiling until linking is done and my application started. Personally I would like to stop Kaspersky completely, but no chance for that. So is there another setting that should be changed on a developer machine? Regards Christian
  2. chkaufmann

    Cyrillic characters in URL

    I use a TIdHTTPServer and have problems with decoding GET variables. The url in the browser looks like this (contains cyrillic characters): Then in the RequestInfo the UnparsedParam and the QueryParams have the value 'search=%D0%90%D0%BD%D1%82%D0%BE%D0%BD&language=ru' In DecodeAndSetParams this is parsed but I don't get the correct results: The request comes from the browser and I didn't change any properties. So I'm not sure how to proceed. I think Indy uses the wrong encoding but I'm not aware, where I can change that? And will all browser use the same encoding? Or do I have to Parse the QueryParams myself? Christian
  3. chkaufmann

    Cyrillic characters in URL

    So this fix will be with the Indy version that comes with Delphi 11? Christian
  4. chkaufmann

    Cyrillic characters in URL

    I think, I found the answer myself now: https://stackoverflow.com/questions/24861793/indy-http-server-url-encoded-request When I add this code, my search string is correct. So probably nothing changed here since 2014. Christian
  5. Hi, I use ExtractHeaderFields() from Web.HttpApp when I parse a post upload. With the following value for "Content" (containing special german characters) this function fails: 'form-data; name="File1"; filename="Test1MitäÄ-Umlaut.pdf"' I get this error: System.SysUtils 33477 TEncoding.GetString System.NetEncoding 1007 TURLEncoding.Decode Web.HTTPApp 2108 ExtractHeaderFields Now I'm not sure if the input is wrong or if I have to use a different function to parse the content of this header (Content-Disposition:). Thanks for any help. Christian
  6. chkaufmann

    ExtractHeaderFields with special characters

    I use Delphi 10.4.2 and the Indy library coming with the default installation. I found that I can set the "Decode" parameter of ExtractHeaderFields() to false, then it works fine. Christian
  7. chkaufmann

    ExtractHeaderFields with special characters

    Ok, the request that comes with this malformed Content-Disposition is created by another Delphi application where I use Indy components. The code looks like this: mPartStream := TIdMultiPartFormDataStream.Create; postDataStream := mPartStream; FHttp.Request.ContentType := mPartStream.RequestContentType; for ix := 0 to FPostNames.Count -1 do begin if FPostFiles[ix].IsNull then mPartStream.AddFormField(FPostNames[ix], FPostValues[ix], 'UTF-8').ContentTransfer := '8bit' else mPartStream.AddFile(FPostNames[ix], FPostFiles[ix].PathName, FPostContentTypes[ix]); end; FPostFiles[ix].PathName is the Windows path of a file. Should I encode it on my side? Or do I have to set another parameter to ensure correct encoding? Christian
  8. chkaufmann

    IDE Memory Usage

    I'm still working with Delphi 10.4.2 and I noticed, that there are two processes DelphiLSP.exe and both take a lot of memory. In addition there is bds.exe which isn't small either. Is this "by default" or can I change that with changing any of my options? Christian
  9. chkaufmann

    TPopupMenu with group headers

    Hi, I would like to add group headers in a TPopupmenu. So I can create things like this: Are there any properties I didn't find yet in the standard VCL? Or can I do that with some additional methods in a TPopupMenu subclass? Christian
  10. chkaufmann

    TPopupMenu with group headers

    Both "problems" are solved by setting Enabled=False for the group header item. Like this the color never changes and clicks on it are ignored. Christian
  11. chkaufmann

    TPopupMenu with group headers

    Thanks for all hints. I created a subclass of TMenuItem and did an override of the AdvancedDrawItem method. In addition I set Enabled=False. Themes are not support, but I don't have that anyway in my application. But so far it looks fine: procedure TMenuGroupItem.AdvancedDrawItem(ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState; TopLevel: Boolean); begin ACanvas.Brush.Color := TColors.Silver.Lighten(50); ACanvas.FillRect(ARect); ACanvas.Font.Color := TColors.SysWindowText; ACanvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, StripHotkey(Caption)); end; Christian
  12. I have a generic method that requires an enumeration type and a value in this enumeration. Right now my function definition looks like this: procedure Foo(ASetType: PTypeInfo; ADefault: Integer); This works fine. With GetTypeData() I can extract what I need (number of elements in enumeration). However, in the usage of this function I have to add TypeInfo() and Ord() each time: type TSet1 = (a11, a12, a13); TSet2 = (a21, a22, a23) then I can call: Foo(TypeInfo(TSet1), Ord(a12)); Foo(TypeInfo(TSet2, Ord(a23)); My question is, how to define the two parameters in order to avoid the TypeInfo() and the Ord() each time? Christian
  13. chkaufmann

    TPopupMenu with group headers

    Yes, this is what I need to do (grouping titles). Regards Christian
  14. chkaufmann

    TPopupMenu with group headers

    Ok I added a disabled item ("Bearbeiten") in this case, but it's still aligned with all other items. And setting the Break property just adds a vertical line on the left side: So what do I have to do to align the "Bearbeiten" Text at the left and to change the text color/background? Christian
  15. Hi, in my 10.4.2 installation, the font color for items in the "To-Do" list is just too light and I would like to change it to a gray with a bit more contrast. Is there a simple way to change that? Christian
  16. chkaufmann

    How to work with Spatial Database with Delphi

    It depends on what you plan to do. TatukGIS DK is a very good GIS library. We use it since 20 years. It offers a great map viewer component and the enterprise edition covers all common spatial formats. It's not expensive compared to ESRI products, but it's not cheap either. If you just have some spatial data in a PostgreSQL/PostGIS database you can build your own SQL statements quite easy. Geometries are represented as WKT which is quite straight forward to understand. But of course it means programming work on your side. Regards Christian
  17. chkaufmann

    Error with TClientDataSet

    I have an old project where I use TClientDataSet (unit DBClient.pas). When I recompile this one with Delphi 10.4.2 I get the following hint: Hint: H2161 Warning: Duplicate resource: Type 16 (VERSIONINFO), ID 1; File Pyramid.res resource kept; file C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\Win32\release\DE\midas.res resource discarded. Is this a (new) problem in my code or is this an error in the Delphi library code? Regards Christian
  18. And I can confirm, that this fix works fine for me.
  19. I just started to work with 10.4.2 (10.3. before) and have the same problem.
  20. When my application runs in an RDP session I get the following error: exception class : EOSError exception message : System Error. Code: 8. Not enough memory resources are available to process this command. 00469607 Logo12.exe System.SysUtils RaiseLastOSError 004696d7 Logo12.exe System.SysUtils Win32Check 00547faa Logo12.exe System.Classes THandleStream.SetSize 005461af Logo12.exe System.Classes TStream.SetSize64 010931ff Logo12.exe ZipForge 7047 TZFBaseArchiver.ForceUpdate 0109a2ea Logo12.exe ZipForge 9754 TZFBaseArchiver.EndUpdate 0109cd7e Logo12.exe ZipForge 10780 TZFBaseArchiver.DeleteFiles 0125d084 Logo12.exe BSStreams 939 TBSZipStreamWriter.Close The problem is, the error doesn't happen on all clients, it even happens on some clients one day and the other day it's not reproducable. What I know is, it happens when the application creates and writes to a local file during a backup and it happens when the function SetEndOfFile(FHandle) is called. The error only apears when I try to save to a local file (located on any \\tsclient\.... path). When I search the internet I don't find anything helpfull except about changing the settings for the Windows pagefile. Unfortunately the provider of our RDP plattform / servers cannot reproduce the problem. So I'm stuck somehow, I don't even understand if the error message points to the real problem. And I don't understand if this is a problem of resources on the local client or on the server where the RDP session is hosted. Something else I know is, that some customers get the same error message when they launch the File Explorer in an RDP session and try to copy a big file from their local drive to the server. Therefor I think the problem cannot be in my application itself, it has to do something with the OS configuration on the server or on the client. So any hint to isolate and fix the problem is welcome. Thanks. Christian
  21. chkaufmann

    Problem with local resources in RDP Session

    I changed my code and the error seems to be gone. Thanks a lot. Now my last question is: Are there other potential problems I may have with my application when running in an RDP session? Especially other problems when loading / saving files from local drives? Until now I didn't find a good resource in the internet about where I should be carefull in my application in order to make it run without errors in RDP sessions: Regards Christian
  22. chkaufmann

    Problem with local resources in RDP Session

    I think I can change the code and create the .ZIP as temporary file and then copy/move this file to the local file on \\tsclient\..... - Normally I use CopyFile() or MoveFile(). What works better with the RDP protocol? - When I look at Windows.pas unit there are many variants of these functions. Should I use a different one? Thanks for your help. Regards Christian
  23. chkaufmann

    Smtp avoid spam classification

    Hi, my provider uses https://rspamd.com/ to check emails before sending out. Now my emails get classified by some modules and I would like to solve this: One is https://rspamd.com/doc/modules/chartable.html Normally I just add text with FMessage.Body.Add() and then I set this: FMessage.ContentType := 'text/plain'; FMessage.CharSet := 'UTF-8'; Is Indy not doing the conversion correctly? The second one is https://www.rspamd.com/doc/modules/mime_types.html this one. The others don't give a big score: R_MIXED_CHARSET 2.89 Mixed characters in a message MISSING_MIME_VERSION 2.00 MIME-Version header is missing in MIME message R_BAD_CTE_7BIT 1.05 Detects bad content-transfer-encoding for text parts 7bit;utf8; Can somebody give me a hint on how to fix this? Christian
  24. I use a cache for sql query results. For this I create a key with THashBobJenkins for the sql string and then I have dictionary with the results with these hashes as key. Unfortunately I run into a problem that two different sql strings give the same hashkey. So I probably have to use the whole sql string as key. Or can somebody provide me a good solution to reduce the sql string to a "smaller" key without loosing uniqueness? Christian
  25. I use the full sql string as key now. Maybe I'm just too old - sometimes still thinking that having several thousand strings as keys may affect performance... Christian
×