Jump to content

FPiette

Members
  • Content Count

    1167
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by FPiette

  1. Here an example: program Crcr32Demo; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.ZLib; var Buf1 : AnsiString; Buf2 : String; Crc : UInt32; begin Buf1 := 'Hello World!'; Crc := System.ZLib.Crc32(0, PByte(Buf1), Length(Buf1) * Sizeof(Buf1[1])); WriteLn('AnsiString ID=', IntToHex(Crc, 8)); Buf2 := 'Hello World!'; Crc := System.ZLib.Crc32(0, PByte(Buf2), Length(Buf2) * Sizeof(Buf2[1])); WriteLn('UnicodeString ID=', IntToHex(Crc, 8)); ReadLn; end. The output is: AnsiString ID=1C291CA3 UnicodeString ID=E2106423 AnsiString and Unicode string doesn't produce the same result because character code are different (8 bit and 16 bit per character). and CRC32 work at the byte level.
  2. Why don't you use what I proposed? You will always get an 8 characters key and make use only Delphi RTL functions. Please comment on this. I proposed you use CRC32 which is a kind of hash. https://docwiki.embarcadero.com/Libraries/Sydney/en/System.ZLib.crc32 IntToHex: https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.IntToHex
  3. One possibility is to use a CRC32 applied to the text and then convert the resulting UInt32 to hex-ascii representation. See CRC32: https://docwiki.embarcadero.com/Libraries/Sydney/en/System.ZLib.crc32 IntToHex: https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.IntToHex
  4. FPiette

    VCL DB App. To Cloud

    That is a very different thing. The rule: correctly define what your problem is and you'll get the best answers.
  5. FPiette

    VCL DB App. To Cloud

    There is nothing very special to the "cloud". The cloud is just a bunch of computer in a remote data center. Those computers are running an operating system, some of which are Windows and are able to run a VCL Delphi application. One solution is to use a virtual desktop solution. For example this : https://learn.microsoft.com/en-us/azure/virtual-desktop/overview
  6. Delphi is not even supported on Windows 2008. https://docwiki.embarcadero.com/RADStudio/Athens/en/Installation_Notes#Operating_System_Requirements
  7. Have a look at the demo program OverbyteIcsSslWebServ.dproj! In OverbyuteIcsSslWebServ1.pas, look at method SslHttpServer1PostDocument(). If the posted URL is the one you expect (In the demo, this URL is '/cgi-bin/cgifrm1.exe' and no, there NO cgifrm1.exe program, this is just a kind of virtual program), you have to allocate space for the posted data and return with Flags set to hgAcceptData. Then since you accept data, you'll get one or more PostedData events (Data comes in chunks). In the demo, look at SslHttpServer1PostedData(). In my opinion, this demo is exactly what you want to do. Study it carefully. BTW: If you don't do what I said (Edit you message to translate it in English, even in bad English. Use Google translate if needed), then you delay the answer. Now, study the sample I pointed to you, revise your code and if you still have an issue, post a NEW question, in English.
  8. Please translate your post to English (Use the Edit button).
  9. It is a problem for application which make use of a state machine, something I use frequently. Having an event triggered twice add useless complexity at the application level and leads to bugs, especially for "final" event like OnRequestDone. It is better to handle that in the component.
  10. Please stay on subject. This forum is for ICS only. If you have question about ICS, you are welcome here. For IIS and other subjects please use one of the many other forums on this server. One more note: you are deviating significantly from the original topic of this discussion. Please create a new discussion for each topic. Here we have a forum and not a chat.
  11. I don't need DataSnap: I have ICS which does it all.
  12. I never had any issue with what you call garbage. I'm afraid that the problems you are experiencing actually come from your "manual" manipulation of the dproj. The whole dproj file is not big. This count for nothing in disk space.
  13. That makes no difference. A datamodule is just a kind of form without UI at runtime. It's just an easy way to use the object inspector to assign properties and events to the non-visual components and keep thing in various units.
  14. FPiette

    SSLWebSocketCli as DLL

    That's a good idea Angus. Restore also the sample application (OverbyteIcsDllTst1) loading the DLL.
  15. FPiette

    SSLWebSocketCli as DLL

    For a DLL, I recommend to put the message pump in a separate thread along will all code related to ICS events. Why? Because you have no control on what the application loading the DLL is doing with Windows messaging and because you don't know how that application calls the DLL's function (could be the main thread or a worker thread). In ICS V8, there was a sample program showing that. It has been removed from V9 😢 You still access it in this place : http://svn.overbyte.be/svn/ics/trunk/Samples/Delphi/OtherDemos The project is OverbyteIcsDll1.dpr. This project needs probably some minor changes to be compiled with V9.
  16. What i said can be done with the IDE. You know I'm using Delphi since the first version in 1995, maybe before your own birth. No, you don't need to edit the dproj file. If you do, you will likely mess it. I'm sure. Please leave this conversation and restart a new one in the appropriate forum. Try to better describe your problem there.
  17. Are you sure both are VCL (or FMX) application? Does the ICS demos work ? That's not a good idea! Only experts could modify .dproj files manually. You must use project options to change the dproj which the IDE create and update for you. I suggest you delete (or move to a backup directory) all your dpr and dproj files. Then start new empty projects and add your forms and datamodules to the project. Remove the empty form created at the same time as the project, make sure that your mainform is selected as mainform. All that using the IDE only. Do *NOT* change any dpr or dproj file manually. Make sure ICS source and include directories are in the project option for target "All configurations" (Building / Delphi compiler / Search path).
  18. FPiette

    x32->x64

    Try using THandle data type for all handles.
  19. NaN Anders, I'm not sure that NaN is a good choice because this special value is generated in other cases. Something like 2.12345e-308is a better choice and collision risk is much lower.
  20. It depends on what your function does, but just like a function returning an integer returns a special value (often -1 or 0) in case of error, your function could return a special value as a double number. Carefully select the value so that it doesn't collide with expected values in your application. I'm think about a value like 2.12345e-308. Just define a constant to give that value a nice name easy to use and remember.
  21. FPiette

    rare unrepeatable memory errors

    Yes it can! That's why high-end PC, workstation and server have "ECC Memory" (Error correction code memory, see this Wikipedia article). When an error occurs, it is corrected and you are notified. You can continue to work while ordering a new memory item. Think about it when you'll buy your next computer.
  22. Sorted CSV is an easy way to handle comparison you need. And if more advanced comparison is required, you may load the CSV in a SQL database (maybe SQLite) or even use a spreadsheet like Excel if you are comfortable with VBA. Excel can directly load CSV files. Of course you can write your analysis in pure Delphi. You'll easily find a library to load a CSV file in an array in memory. What you shall use depends on your preferences and skills.
  23. Plain text CSV is my prefered format. I would make each line with details specific to an item. Order of cells in a line would be in the importance to compare them. Sort the whole file alpabétically at the end. Use WinMerge utility to quickly compare the files. Write a dedicated software to read the CSV and make more complex comparison if needed. Example of a line syntax: Storage, HardDisk, SerialNumber, BrandAndModel, Capacity Example of an actual line: Storage, HardDisk, 22RKKA0, WDC WD10EZEX, 953667MB
  24. Check if you have invalid path in Delphi options and in project options. Any invalid path, specially network path takes a lot of time.
  25. FPiette

    Registration Limit

    Then contact your sales representative, preferably the one which sold you the license and explain why you need more licenses.
×