Jump to content

Cristian Peța

Members
  • Content Count

    437
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Cristian Peța

  1. Cristian Peța

    Migrating away from Indy for file downloads

    TNetHttpClient is a component that uses THttpClient internally. If you don't need what TNetHttpClient offers then use directly THttpClient. TNetHTTPClient = class(TComponent) private FHttpClient: THTTPClient;
  2. Cristian Peța

    Olaf Monien's Multithread demo on DelphiCon was nice!

    Is the source somewhere to download?
  3. "On 64-bit versions of Windows, you have two separate Program Files folders. But it doesn’t end there. You also have two separate system directories where DLL libraries and executables are stored: System32 and SysWOW64. Despite the names, System32 is full of 64-bit files and SysWOW64 is full of 32-bit files. " https://www.howtogeek.com/326509/whats-the-difference-between-the-system32-and-syswow64-folders-in-windows/
  4. If your OS is 64 bit and you have a 32-bit service then search an other place like SysWOW64.
  5. Delphi 10.4.2 I try to understand this exception. I occurs at the app start and this is the only message, then the app closes. It happens only on one machine and the same code but truncated by some IFDEFs (a reduced version of the main app) is working. I suppose that class destructor TDBNavigator.Destroy is called when class constructor TDBNavigator.Create is still looping with FButtonsImageCollection.Add() But what means this address 400000? exception class : EAccessViolation exception message : Access violation at address 76B6C9ED in module 'combase.dll'. Write of address 00400000. thread $4b7c: 76b6c9ed +db combase.dll 00e3c89a +22 WinArhi.exe Vcl.ImageCollection 282 +2 TImageCollectionSourceItem.Create 0054c757 +0b WinArhi.exe System.Classes 6213 +1 TCollection.Add 00e3c965 +05 WinArhi.exe Vcl.ImageCollection 325 +1 TImageCollectionItemSources.Add 00e3d48b +53 WinArhi.exe Vcl.ImageCollection 651 +9 TImageCollection.CreateSourceItem 00e3d576 +2a WinArhi.exe Vcl.ImageCollection 670 +1 TImageCollection.Add 00e3d65a +76 WinArhi.exe Vcl.ImageCollection 683 +2 TImageCollection.Add 00e4f11d +7d WinArhi.exe Vcl.DBCtrls 4188 +3 InitButtonsImageCollection 026cb28d +09 WinArhi.exe Vcl.DBCtrls 4192 +1 TDBNavigator.Create@ 0040b186 +42 WinArhi.exe System 23832 +21 InitUnits 0040b1ef +3f WinArhi.exe System 23907 +14 @StartExe 004140fa +42 WinArhi.exe SysInit 1535 +11 @InitExe 026f025f +0b WinArhi.exe WinArhi 277 +0 initialization 75f7fa27 +17 KERNEL32.DLL BaseThreadInitThunk
  6. Cristian Peța

    Strange exception with "Write of address 00400000"

    Yes, there was some trouble over the 20 years of using it.
  7. Cristian Peța

    Strange exception with "Write of address 00400000"

    Solved. The issue was caused by Sentinel envelope that is applied to the executable. The envelope decrypts and decompress the EXE in memory and is doing a lot of other stuff. The envelope permitted to start the executable but because some incomplete installed drivers I suppose it does not do all the job to restore all what is needed to run properly.
  8. Cristian Peța

    Maximum static memory

    If the speed is the problem then I think better to use a profiler and save your time guessing. Using SetLength frequently on a large array is clearly a big one. VTune is nice using https://bitbucket.org/anders_melander/map2pdb/src/master/
  9. I prefer that changing the SQL to simply close the dataset. Then possibly I want to set some parameters. I will open it again when all is ready. But sincerely I always call Close before changing SQL. If this is a documented behavior then it's OK but otherwise this can change anytime. I voted for the last. It's closer to what I prefer.
  10. Cristian Peța

    Physically reduce jpeg image size??

    If you don't want to compromise quality there is https://www.jpegmini.com/ There are some ways for developers to automate this but you can also buy a standalone app for 59$ and do it manually (first extract images to a folder then back to database). I think that with a free trial you can see how much it helps in your case.
  11. Cristian Peța

    need code to receive low memory warning

    Set an event handler: if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, IInterface(AppEventService)) then AppeventService.SetApplicationEventHandler(My_ApplicationEventHandler); And in that event you will receive the warning: function TFormMain.My_ApplicationEventHandler(AAppEvent: TApplicationEvent; AContext: TObject): Boolean; begin case AAppEvent of TApplicationEvent.LowMemory: ; end; end;
  12. Cristian Peța

    take a look to this REST API Server

    I don't see the point. Delphi app is used only to serve Angular pages? What are the advantages over Angular own embedded HTTP server?
  13. Cristian Peța

    Range check error.

    If Count is 0 then Str[1] will trow a range check.
  14. Cristian Peța

    Using VMWare: what files remain on host?

    I start a new VM for every major app version and I want old versions to be stable. In this case I prefer to keep the sources in VMs. I don't write 3rd party components and I need only one Delphi version per my app version. It is easier so. When I start a new version I do a copy of the VM and all is there.
  15. Cristian Peța

    Has anyone tried running Delphi on Windows ARM?

    From what I understand from the article it's "the Arm version of Windows". No emulator. But this Windows can run x86 code, like Delphi IDE, most probably using an emulator.
  16. Cristian Peța

    How to kick TDataset to filter record(s)

    Yes, whole dataset, but how match it takes? What do you want to optimize? Do you keep in memory more than some thousands records?
  17. Cristian Peța

    How to kick TDataset to filter record(s)

    DataSet.Filtered := False; DataSet.Filtered := True; Is working for me when using OnFilterRecord event.
  18. Customers asked me a long time ago for a feature to be able to introduce the length in inch in "12 3/16" format in a TEdit like control. I've made a component for this but with the new TNumberBox in Delphi 10.4.2 I wonder if this is usual and if there are some components for this in Delphi world?
  19. Cristian Peța

    Intraweb/MS SQL/FireDAC app Azure deployment problem...

    I use UniDAC and in such a case I would use DBMonitor to see what queries are send to the server. I don't know if FireDAC has something like this but from what I know, if I'm not mistaken, you can see failed queries also in Azure.
  20. Cristian Peța

    Trying to share a text file

    This "image/text/plain" is strange for me. You can try this. This will enable share for image and text. If you need only text delete the "image/* " This setType() will filter the applications that supports that type.
  21. Cristian Peța

    Several F2084 Internal Error on Delphi 10.4.2

    Then not the memory limit is the problem. I think I had something similar but long time ago I starter to avoid compile and use build almost every time. It is better to wait 10-15 seconds (in my case) than to fight with these issues. If I remember well this started for me about ten years ago when iOS was first introduced as a new platform.
  22. Cristian Peța

    Trying to share a text file

    And what if you omit this line? Intent.setPackage(StringToJString('com.whatsapp'))
  23. Cristian Peța

    Several F2084 Internal Error on Delphi 10.4.2

    If "Use MSBuild externally to compile" helps then probably you have reached the memory limit. You can see in Task Manager if Delphi is approaching 4 GB limit. I have for example 534 MB after a build of 330k LOC.
  24. To send text you could use this function. If the previous change fixed the issue I suppose this will also fix it without to change anything else. You could also store binary data in AnsiString but I would not do this. It's better to use TBytes for this. procedure TThermalPrinter.SendString(AValue: AnsiString); var SND: TBytes; begin SetLength(SND, Length(AValue)); CopyMemory(@SND[0], @AValue[1], Length(AValue)); LSockect.SendData(SND); // send data to the printer end; And better this in TThermalPrinter.DoPrintBitmap() vTempStr : AnsiString;
×