Jump to content

msd

Members
  • Content Count

    20
  • Joined

  • Last visited

Community Reputation

1 Neutral

About msd

  • Birthday May 18

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. msd

    Delphi 11.1 - High DPI

    Hello Uwe, Delphi is not a problem; it works fine. The problem is compiled applications and distributed on computers with high-DPI screens. I need to solve deployed applications... Thanks anyway for the advice.
  2. msd

    Delphi 11.1 - High DPI

    Hello, I have one big project and I migrated it from older versions of Delphi to the latest Delphi 11.1. High-DPI is one of the unsolved issues. When I start the app on a computer which has activated zoom over 100% (High-DPI screen), the whole components are in a mess on all forms. So, how to solve this scenario so that my app can keep resolution and aspect ratio every time in every zoom factor on the client's PC? Thanks for the help and support in advance.
  3. Hello, I have a class which is a representation of some API communication with a REST server and that class has methods that exchange data with the server. Because this class has communication with REST, I can't wait for every response and I would like to add threat functionality to this class. My idea is that when I call the create method of my class, it will start in a separate thread and the whole class will work in its own thread and every method call to this class will be async. The response class (thread in class) informs the main thread that it contains some data and the app can use it. Thanks for the tips and advices in advance...
  4. Hello, I made my custom solution and I got the hardware fingerprint I wanted (for example, 1805-AD75-1308-150F) and it is definitely unique because I'm using 3-5 hardware components when I plan to generate this fingerprint. This is a similar solution to popular DLL components, which return some code to represent a unique hardware id, but in my dev factory. Thank you for all of the professional responses and information:-)
  5. Hello, I need some unique hardware ID code generator which will be a piece of Delphi code or some VCL library without any external dll's or libraries. The idea is that I have all computers in my catalog by hardware id, and when a user has some requests, I find his client computer in my catalog and send him a repair script. The main goal is to provide each client with a unique id across the entire system. Thanks in advance for any tips or samples...
  6. I was made function that works the job 🙂 if someone need it... function EncodePDF(const AFileName: string): string; var inStream: TStream; outStream: TStringStream; begin inStream := TFileStream.Create(AFileName, fmOpenRead); try outStream := TStringStream.Create; try TNetEncoding.Base64.Encode(inStream, outStream); finally Result := outStream.DataString; outStream.Free; end; finally inStream.Free; end; end; if someone has better idea, please post it here 😉
  7. This is a link: https://base64.guru/converter/encode/pdf where you can find how to encode PDF and the correct way to add it to XML. This link was given to us by the developer, and when we use this online tool and generate an XML tag, everything works fine:-) It looks like a simple Base64 encode from Delphi is OK, so if you can give me a sample (only encode/decode part of code).
  8. Because I only work on the client side, I have no experience with server-side encoding. I'm aware that the documentation specifies that nodes with attachments must be document/pdf in binary format. My initial question was about how to convert PDF files to binary and then put it into XML. I'll try Base64 Encoding first, and if it works, I'll put a bit of code here for the other members to see. Thank you for your suggestions...
  9. I wrote that this is a universal doc exchange web app. I'm from the client side. I need to push XML to the web app in XML format with an embedded PDF document.
  10. Hello, This is an example from an existing document... <cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="document_name.pdf">JVBERi0xLjcNCiW.....EmbeddedDocumentBinaryObject> This is a universal app, so there is no specific need for some encoding or decoding, just a simple representation of the binary representation of the document...
  11. Hello, We need to create an XML document file for an online document exchange system, and that XML file must include attachments. I can show you how it appears, but I'm not sure how to add/encode documents into a string that will be used to represent documents in an XML file (like attachment). In other words, how to encode a file into a string that may be used to represent it in an XML structure. Thank you very much...
  12. msd

    Hardware ID

    Hello, I'm working now on Latest RAD Studio and I version incompatibility of my source which is generating some unique HardwareID function InternalGetHardwareID(Hdd: AnsiChar): AnsiString; var pdw: pDWord; mc, fl: dword; ID_1: AnsiString; ID_1L: dword; ID_2: Cardinal; ID_3: Cardinal; ID_5: AnsiString; CPUID: TCPUID; I: Integer; AddOn: Longword; TempStr: AnsiString; TempByte: Byte; Index: Integer; FUniqueID: AnsiString; begin Result := ''; FUniqueID := '{61AF17B9-4EDB-4849-93CD-113C14E139F7}'; try New(pdw); GetVolumeInformation(PChar(Hdd + ':'), nil, 0, pdw, mc, fl, nil, 0); ID_1L := pdw^; ID_1 := IntToHex(pdw^, 8); Dispose(pdw); except exit; end; for I := Low(CPUID) to High(CPUID) do CPUID[I] := -1; if IsCPUIDAvailable then begin CPUID := GetCPUID; ID_2 := CPUID[1] + CPUID[2] + CPUID[3] + CPUID[4]; // First chance exception at $7631ED42. Exception class EIntOverflow with message 'Integer overflow' ID_3 := (CPUID[1] shr 12 and 3) * (CPUID[1] shr 8 and $F) * (CPUID[1] shr 4 and $F) * (CPUID[1] and $F); ID_5 := GetCPUVendor; {$WARNINGS OFF} AddOn := Longword(ID_1L + ID_2 * ID_3); for I := 1 to Length(ID_5) do AddOn := (AddOn xor Ord(ID_5[I])); TempStr := IntToHex(AddOn, 8); Index := 1; for I := 1 to Length(TempStr) do begin {$R-} TempByte := ((Ord(TempStr[I]) xor (AddOn div I)) + Ord(ID_1[I])) div 5; {$R+} {$WARNINGS ON} if poUniqueHardwareID in Options then // This is error line begin TempByte := Ord(FUniqueID[Index]) xor TempByte; Inc(Index); if Index > Length(FUniqueID) then Index := 1; end; Result := Result + IntToHex(TempByte, 2); end; if Length(Result) > 16 then Result := Copy(Result, 1, 16); if Length(Result) < 16 then for I := Length(Result) + 1 to 16 do Result := '0' + Result; end else begin if Assigned(FOnUnknownHardware) then FOnUnknownHardware(Self); // This is error line end; end;
  13. Hello Angus, Could you please, if you have little free time, put here some sample pieces of source code for posting data / JSON in a way that you were described with ICS? Thanks for any assistance and support in advance...
  14. Hello, I have a little bit specific situation with one web service, It receives HTTP requests over the HTTP 1.0 protocol but the problem is when TransferEncoding is Chunked. Can I force TidHTTP not to send TransferEncoding is Chunked? I try with HTTPClient.Request.TransferEncoding := 'gzip, deflate, br'; but I get chunked on the webserver side.
  15. Hello Remy Lebeau, Two very good ideas :-) I plan to use JsonReader because of memory usage and it is fresh tech in RAD Studio, but you give me very good tip. Thanks once again for the all advices...
×