Jump to content

msd

Members
  • Content Count

    68
  • Joined

  • Last visited

Everything posted by msd

  1. msd

    Delphi 12 List Objects x64

    I was given some deep debugging procedures. The problem is in TList. Count when I want to build a project in 64-bit version. So count is the core of the problem. When I set a fixed integer number, everything is working fine. P.S. In the 32-bit version, everything is working correctly with the count method. P.P.S. this is not working on delphi 64 -> LastCol := Cols[Cols.Count - 1].ColNumber + 1; this is working fine on delphi 64 -> LastCol := Cols[Integer(Cols.Count) - 1].ColNumber + 1;
  2. msd

    Delphi 12 List Objects x64

    Hello, 1. FXLSGridSelection: TMapRow; 2. TMapRow = class(TList) This is only a sample; every component that has a TList type has the same problem.
  3. Hello friends, I found this library, named Chilkat Delphi DLL API (https://www.chilkatsoft.com/), and this library has a lot of classes and tools for SSH, SFTP, FTP2, HTTP, REST, socket/TLS, IMAP,... In demo mode, I try RS232, HTTP Server & Client, FTP Server & Client, TCP Sockets, Mail, Zip, Json, XML, Smartcard, Certificates, and Task (multythreading). I have a small distance from using DLL's in Delphi because of speed of development and I prefer full source code, but I have a few component sets that cover all of these functionalities, and I ask for advice from experts. Does anyone use this library set? Is there any performance comparison between DDL and native Delphi libraries? Is it thread-safe? Is it "smart" to replace a lot of components (maintained or not maintained anymore) with a library like the Chilkat Delphi DLL API? Thank you in advance to all of you for any advice and information...
  4. Hello, I have small problem with converting smartcard response to x509 certificate. It look like 3 step process. 1. Smartcard return HEX response 30 82 05 D2 30 82 04 BA A0 03 02 01 02 02 0E 62 20 97 1F 98 E6 F2 89 00 00 00 00 14 AF 30 0D 06 09 2A 86 48 86 F7 0D 01 01 0D 05 00 30 49 31 0B 30 09 06 03 55 04 06 13 02 52 53 31 17 30 15 06 03 55 04 0A 13 0E 50 6F 72 65 73 6B 61 20 55 70 72 61 76 61 31 21 30 1F 06 03 55 04 03 13 18 53 61 6E 64 62 6F 78 20 53 55 46 20 49 73 73 75 69 6E 67 20 43 41 20 31 30 1E 17 0D 32 32 30 31 32 35 30 38 31 39 35 38 5A 17 0D 32 35 30 31 32 35 30 38 32 39 35 38 5A 30 81 C7 31 0B 30 09 06 03 55 04 06 13 02 52 53 31 1B 30 19 06 03 55 04 08 0C 12 D0 9F D0 BE D0 B6 D0 B0 D1 80 D0 B5 D0 B2 D0 B0 D1 86 31 13 30 11 06 03 55 04 07 0C 0A 50 6F C5 BE 61 72 65 76 61 63 31 17 30 15 06 03 55 04 09 13 0E 4D 61 6A 61 6B 6F 76 73 6B 6F 67 20 31 35 31 1B 30 19 06 03 55 04 0A 13 12 4D 53 44 20 41 67 65 6E 63 69 6A 61 20 7A 61 20 49 54 31 1B 30 19 06 03 55 04 0B 13 12 4D 53 44 20 41 67 65 6E 63 69 6A 61 20 7A 61 20 49 54 31 11 30 0F 06 03 55 04 05 13 08 51 42 56 55 41 53 4D 52 31 20 30 1E 06 03 55 04 03 13 17 51 42 56 55 20 4D 53 44 20 41 67 65 6E 63 69 6A 61 20 7A 61 20 49 54 30 82 01 22 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00 03 82 01 0F 00 30 82 01 0A 02 82 01 01 00 B3 F7 B3 77 B0 4D FC E8 B1 57 1E DD A1 73 E1 00 2A 39 A1 C6 CE 56 8F 8E 16 9E B6 87 F1 B5 6B F9 7B 28 89 22 AA 2E 07 CB 06 AA CF 24 E0 8C A9 73 49 5E C8 2E 75 54 44 C0 D8 14 F5 AD 10 9C BC EB 10 4E 2A 78 44 3D 00 92 3F 1A F4 6F 2D 27 AB 1F C3 80 D9 66 31 24 9B 1E 0E F6 2E 77 62 D6 6A 61 A0 32 01 90 A6 5A C0 5E 48 5B ED 1E 2A 8C 79 46 01 99 23 32 03 5E 9F A1 0B 93 17 2E 89 52 DA 99 BF BF 5A CB 81 78 D7 5C 48 FE C9 07 96 83 4F 9F 74 32 D7 87 2F C4 BF BA 41 CC 91 AF 73 28 E9 D0 1D 2D A2 C0 91 08 D0 E4 60 5A 4D DB 0C 5C 7F B5 B4 C1 8A CA 19 1D 46 27 68 D1 97 1B 21 5E 9F 5A 5C 6E B4 80 99 EE A6 CB FD 65 4B 1F 1C 91 DE 38 AA DB F8 B0 E5 C2 C0 E8 C5 16 37 B5 18 EF 80 0A 3A F7 AA 2D F2 C2 64 25 7C CC F9 1E 31 C8 67 A4 38 6D DE BE 7B D2 09 49 BE 09 5B 2B 24 0A 26 71 02 03 01 00 01 A3 82 02 37 30 82 02 33 30 0F 06 03 55 1D 13 01 01 FF 04 05 30 03 02 01 00 30 0E 06 03 55 1D 0F 01 01 FF 04 04 03 02 04 90 30 17 06 03 55 1D 25 04 10 30 0E 06 0C 2B 06 01 04 01 83 86 20 05 08 03 03 30 81 C5 06 03 55 1D 20 04 81 BD 30 81 BA 30 81 B7 06 0C 2B 06 01 04 01 83 86 20 05 08 04 02 30 81 A6 30 32 06 08 2B 06 01 05 05 07 02 01 16 26 68 74 74 70 3A 2F 2F 70 6B 69 2E 73 61 6E 64 62 6F 78 2E 73 75 66 2E 70 75 72 73 2E 67 6F 76 2E 72 73 2F 70 6B 69 30 70 06 08 2B 06 01 05 05 07 02 02 30 64 1E 62 00 73 00 61 00 6E 00 64 00 62 00 6F 00 78 00 55 00 73 00 65 00 20 00 70 00 4B 00 49 00 53 00 72 00 62 00 69 00 6A 00 61 00 53 00 61 00 6E 00 64 00 62 00 6F 00 78 00 20 00 69 00 73 00 73 00 75 00 61 00 6E 00 63 00 65 00 50 00 6F 00 6C 00 69 00 63 00 79 00 20 00 63 00 6C 00 61 00 73 00 73 00 32 30 32 06 0B 2B 06 01 04 01 83 86 20 05 08 05 04 23 68 74 74 70 73 3A 2F 2F 61 70 69 2E 73 61 6E 64 62 6F 78 2E 73 75 66 2E 70 75 72 73 2E 67 6F 76 2E 72 73 30 18 06 0B 2B 06 01 04 01 83 86 20 05 08 06 04 09 31 30 34 37 37 35 37 33 37 30 1D 06 03 55 1D 0E 04 16 04 14 3C 93 36 92 AE 4C E5 65 BD C9 CE 8B F9 B0 BD A1 17 CE 9E F6 30 1F 06 03 55 1D 23 04 18 30 16 80 14 33 24 82 AB BB 7B F1 55 69 81 18 B8 DE 97 1B 0B DF E4 A1 E1 30 4A 06 03 55 1D 1F 04 43 30 41 30 3F A0 3D A0 3B 86 39 68 74 74 70 3A 2F 2F 70 6B 69 2E 73 61 6E 64 62 6F 78 2E 73 75 66 2E 70 75 72 73 2E 67 6F 76 2E 72 73 2F 70 6B 69 2F 53 55 46 49 43 41 31 53 61 6E 64 62 6F 78 2E 63 72 6C 30 55 06 08 2B 06 01 05 05 07 01 01 04 49 30 47 30 45 06 08 2B 06 01 05 05 07 30 02 86 39 68 74 74 70 3A 2F 2F 70 6B 69 2E 73 61 6E 64 62 6F 78 2E 73 75 66 2E 70 75 72 73 2E 67 6F 76 2E 72 73 2F 70 6B 69 2F 53 55 46 49 43 41 31 53 61 6E 64 62 6F 78 2E 63 65 72 30 0D 06 09 2A 86 48 86 F7 0D 01 01 0D 05 00 03 82 01 01 00 9A 4F CE 46 7B E8 8F 14 D4 E3 D8 6A 83 7D EC 6E 21 3E F7 8D 7A E8 3C D9 F5 68 9F 73 88 AD B8 7E 0D 5E 4A 34 15 68 11 0E A8 74 A6 EA F6 C0 9C C4 0C 2D 9B A6 7D CD 10 8E FE AC 5A 28 54 CF 59 C4 B9 8A D0 EB B6 58 09 52 10 0E D1 27 56 3B 5D 22 0B 1E 88 AF C3 8F 8E 38 11 96 EE 57 79 98 86 82 9E BF 09 E7 E7 D4 F0 13 E4 6D 37 EB 51 F8 92 BD 05 BA A8 CA 53 B7 3B F4 DB D1 9F 71 A4 9F BC 9D 53 DF 84 85 EE CA AA C5 E7 9C C3 F9 48 3F 90 75 B1 BA 22 49 75 4D 1D 6E D0 D5 5C DB 66 D4 9E 7B 14 C5 28 A8 20 83 B7 64 E1 7B A1 EF 5F 9E 93 8F D4 88 F7 38 D8 38 90 9A FA 40 55 9D 61 6F 14 5C 75 B7 4D F8 34 CB FF 01 2E 42 1B B5 B3 9A 94 CA 92 7B 6E 6A 49 C7 EC B6 AF 1B 2F 19 BB 5D 6F 99 67 8E A3 C4 86 B5 A4 8E A9 44 25 29 CD 08 E0 83 0E A9 F0 22 62 EF 1F 78 76 57 31 80 C6 F7 26 BC 2. This HEX response I need to convert to Byte Array 3. I need to convert Byte Array to text representation (string, widestring, ...) I need some function (if Delphi has it or custom) for HEX to ByteArray and then ByteArray to TEXT ? Thanks for the help in advance...
  5. msd

    Hext to Byte to Text = x509 cert

    Very, very, very good and useful toolset with great documentation and a lot of features 🙂 Next weekend we are doing serious testing for ICS and middleware (we have a lot of net-based projects and we need to add a unique solution for online and network operations and one big KBMMW-based project that needs to be refreshed because of performance, security, and stability of data). Thanks again for all the information...
  6. msd

    Hext to Byte to Text = x509 cert

    Hello, Kas Ob, Your function works perfectly, and thanks for this sample method. I want to ask one more question: which library or how to completely parse the X509 cert from Delphi to get all the details and data + public key? Thanks in advance...
  7. msd

    Hext to Byte to Text = x509 cert

    The original info from the official documentation is that I got, for example, this 00 00 08 99 7D FB 1A 03 8D 7E A4 C6 80 00 response. I need to convert this data from hex to bytes and use half for the control sum and another half for the total sum. As I can see in their example, they created 2 separate arrays of bytes, set the first byte to 00, and then added the rest of the 7 from the response. I try to convert this method in Delphi's way like this: SetLength(answer, 14); answer[00] := $00; answer[01] := $00; answer[02] := $08; answer[03] := $99; answer[04] := $06; answer[05] := $F6; answer[06] := $5A; answer[07] := $03; answer[08] := $8D; answer[09] := $7E; answer[10] := $A4; answer[11] := $C6; answer[12] := $80; answer[13] := $00; SetLength(bb, 16); bb[0] := 0; Move(answer[0], bb[1], 7); bb[8] := 0; Move(answer[7], bb[9], 7); Move(bb[0], controlSum, SizeOf(Int64)); Move(bb[8], totalSum, SizeOf(Int64)); in this example controlSum is 3.693.490,87 and totalSum is 100.000.000.000,00. this is values behind this response in hex format. Thanks one again for all...
  8. Hello friends, I need some advices about how to use APDU Commands on Smart Cards with Delphi using T1 Communication Protocol. Thanks for any advice and useful help in advance...
  9. Hello, This is what I found as very good delphi tools for work with APDU commands https://github.com/johnidm/PCSCSmartCardComponent
  10. msd

    Hext to Byte to Text = x509 cert

    Hello FPiette , Yes, it is an array of bytes, and I represented it as a formated string in my first post. Hello, Kas Ob. Your demo is working fine; it is an ASN.1 x509 certificate. I took a long time to study all aspects of this post, and I found that my smart card always returns TBytes as a response, like it was represented in my first post. So I have one more question about this subject (I'll give you a sample). When I call some kind of SUM from Smart Card over the APDU command, I get an answer like this: 00 00 08 99 7D FB 1A 03 8D 7E A4 C6 80 00 (this is a response in HEX format as TBytes in Delphi). In this answer, I have the first 7 bytes as the control sum and the second 7 bytes as the total sum (I know that the second number is 1.000.000.000). My question is how to convert the array of bytes (TBytes data type) to a string or number in this case. P.S. I can give you a piece of code in Java that is working for this sample: ByteBuffer bb = ByteBuffer.allocate(16); bb.put((byte)0); bb.put(answer.getData(), 0, 7); bb.put((byte)0); bb.put(answer.getData(), 7, 7); bb.position(0); long controlSum = bb.getLong(); long totalSum = bb.getLong(); Thanks for all the help and assistance in advance.
  11. msd

    Hext to Byte to Text = x509 cert

    Hello, Kas Ob, Your sample works fine, but I need to convert the HEX response to bytes and then to text representation (so this function doesn't work in the second step). I get responses in Delphi as TBytes.
  12. msd

    Work with PDF documents

    Hello Developers, I have one specific situation with PDF documents. I get one PDF document for over 2.500 invoices as one file with 2.500 pages, and I need to separate every page of that document as 2.500 separate documents for each Byer and read two positions of the current page to get information about Byer. I found a lot of documentation, but there are no samples like this. If someone has an idea or experience with these PDF problems, please post it here. Thanks in advance...
  13. msd

    VCL Wrap

    Hello, I saw in one of the demo sources from DevExpress that they use TdxForm or TdxRibbonForm instead of TForm, but there are no VCL components in the DevExpress VCL list of components. In the description of the source I just need to change the class from TForm to TdxForm, and I have new properties for development and design. So, my question is: can I or how can I wrap some VCL without creating a new VCL component and adding some properties and events? Thanks in advance...
  14. Hello friends, I need some advice about Delphi as a TCP/IP server from you, Delphi developers.🙂 Scenario: I have about 25 computers with permanent connections to the TCP/IP server component. Every client has a dedicated server IP address, which is only one point in this story. Every client sent some HEX code, which I read with ReadByte on the TCP Indy Server, and according to that data, I know the clients locations and IDs. Those clients are LED displays that represent numeric data sent by a TCP/IP server. Problem: With Indy 10 and Delpi Latest, my app freezes after 1 to 3 hours of use. Only Indy can read those bytes from cache data, and the connection must be permanent. Q: Is there any VCL on the market that has TCP/IP Server-Client with these features? P.S. I tried with demo versions of DevArt Secure Bridge and Internet Component Suite, and I couldn't read bytes, only raw text. Thanks for any advice or help in advance.
  15. msd

    Delphi / TCP/IP Server

    Hello, In peak time, it can be 5–10 times per second (it is not as heavy as it looks in my description). I have one more method, which is to create a response, and it must be thread-safe. I'll post it here as part of this message. The whole system has two parts: the first is communication with counters, and the other is information about which counter needs to show which number. So, all counters are 100% online with an open connection, and after the system receives new data from another side of the system, it must search all connected counters and pass new data. This is another important part of the code. function TFServer.cliSendData(cliIP: string; cliCMD: string = ''; cliAddress: string = ''; cliValue: string = ''): Boolean; var i: integer; cliList: TList; byteMsg: TidBytes; cntClient: TIdContext; function SetCounter(dspAddress, dspValue: string): TidBytes; begin SetLength(bytes, 8); bytes[0] := BYTE_START; bytes[1] := BYTE_DATA; bytes[2] := $31; bytes[3] := $00; case StrToInt(Copy(cntValue, 1, 2)) of 00: bytes[4] := $00; 01: bytes[4] := $01; 02: bytes[4] := $02; 03: end; bytes[5] := $00; case StrToInt(cntValue[3]) of 0: bytes[6] := $00; 1: bytes[6] := $01; 2: bytes[6] := $02; end; bytes[7] := BYTE_STOP; result := bytes; end; begin byteMsg := SetCounter(cliAddress, cliValue); try cliList := DisplayServer.Contexts.LockList; for i := 0 to cliList.Count - 1 do begin cntClient := TIdContext(cliList); // AContext.Connection.Disconnect if cntClient <> nil then try if (cliIP = 'ALL') or (cliIP = cntClient.Binding.PeerIP) then begin cntClient.Connection.IOHandler.Write(byteMsg); cliInfoMessage(dspLog, 'SERVER', cliLogDateTime() + ' - Send: ' + cliCMD + ' to Client: - ' + cntClient.Binding.PeerIP); end; except end; end; finally DisplayServer.Contexts.UnlockList; end; result := true; end; Thanks to all developers for their help and assistance.
  16. msd

    Delphi / TCP/IP Server

    Hello. I have one TCP/IP server by the Indy component and one memo field for some kind of monitoring. Indy component accepts connection, sends identification request to client, and opens and keeps openend connection. I'm using three events: OnConnect, OnDisconnect, and, of course, OnExecute. The first two just accept and log connection status and details; everything else is on the OnExecute event. I can represent the function that updates the monitoring memo component. function TFServer.cliInfoMessage(info: TMemo; send, msg: string): Boolean; begin TThread.Queue(nil, procedure begin info.Lines.Append('/' + send + '/' + msg); end); result := true; end; Another function is the response function, which can be bad coded because it does not generate a response for client activity on an open connection. P.S. Yes my app is freeze from r time to time and power up CPU to 100% for few minutes. Thanks again for all...
  17. msd

    Windows Service + kbmMW

    Hello, I would like to develop a KBMMW-based Windows Service Application. So I need a little assistance with this idea, with code for starting and monitoring KBMMW components. KBMMW is some kind of middleware framework that connects to databases and provides server connections to clients. So, I need to develop a classic Windows service application, which has a part where I need to register services and start the KBMMW Server listener to true. Do I need to execute the main thread of the service app because the KBMMW server is a listener on the port by itself, and is it ok to put this part of the code (registration services) in the service start event handler? Thanks in advance...
  18. Hello, I have a problem with failed printer jobs. When I have one failed printer job, all the rest are on hold, and there are no prints. So, I need some ideas on how to empty all or just failed printer jobs from the printer to free a new one. I'm using Fats Report from Delphi, and if there are ideas from the Fast Report API, that is okay also. Thanks in advance...
  19. Hello, If I want to set all params of Delphi function to be const (because of small amount of memory) do I need to define it as: function FnName(const varA: string; const varB: integer; const varC: boolean = false): boolean; OR function FnName(const varA: string; varB: integer; varC: boolean = false): boolean; Thanks in advance...
  20. Hello,, I was installing a fresh new version of RAD Studio 11.2 and on some packages I get this error (for example, I show it on kbmMW): [dcc64 fatal error] kbmMWGlobal.pas(34): E2213 Bad packaged unit format: [dcc64 Fatal Error] kbmMWGlobal.pas(34): E2213 Bad packaged unit format: C:\Users\Public\Documents\Embarcadero\Studio\22.0\Dcp\kbmMemRunD110Pro.dcp.kbmList - Expected version: 35.0, Windows Unicode(x64) Found version: 35.0, Windows Unicode(x86) I have this error in a few cases for different VCLs. Thanks in advance...
  21. msd

    Rebuild & Install VCL

    Solved 😉 Add $(BDSCOMMONDIR)\Dcp\Win64, before $(BDSCOMMONDIR)\Dcp in Library Path and everything works fine...
  22. Hello, On the form OnFormKey UP or DWN, we can use the entire keyboard, but for the numeric part, we have VK_ADD, VK_MULTIPLY,... I need some advice for using those keys in OnFormKeyDown, Up, or Press like this sample below: When a user searches for data in the TEdit VCL by typing letters and numbers and then clicking on the numeric + key VK_ADD, the app does something BUT WITHOUT adding +char to the TEdit VCL control. Simple: I need to use those keys but without the characters they represent: +, -, /, and *. Thanks for the advice in advance...
  23. Hello, I would like to add some extra features to standard Delphi VCL components. For example, I want to expand the TEdit class with some properties and evets. When I create class TmyEdit = class(TEdit) in runtime, it works fine. I call the create method and I can use it. But! I need to have a TmyEdit as a VCL component which can be put in a form at design time and configure some properties and connect some events at design time. I tried with Initialization RegisterClass(TmyEdit), but the same error is there. The error is: class TMyEdit is not found. Ignoring this error will delete this component... Thanks for any info and advice in advance...
  24. 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...
  25. 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.
×