Jump to content

FPiette

Members
  • Content Count

    1114
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by FPiette

  1. Your TImageList seems to contain 16x16 pixels images. That's why it is pixelated. Use the same size - in pixels - as the source image.
  2. I'm writing an application which read data from an external one. An XML file is used between. The external application has color defined by names while in my application, I have ARGB values. It is trivial to convert from color name to ARGB value: function ConvertGpxColor(const S : String) : UInt32; begin // AABBGGRR if SameText(S, 'Red') then Result := $FF0000FF else if SameText(S, 'Green') then Result := $FF00FF00 else if SameText(S, 'Yellow') then Result := $FF00F0F0 else if SameText(S, 'Blue') then Result := $FFFF4040 else if SameText(S, 'Magenta') then Result := $FFFE01FE else if SameText(S, 'Cyan') then Result := $FFFFFF00 else if SameText(S, 'White') then Result := $FFFFFFFF else if SameText(S, 'Black') then Result := $FF000000 else if SameText(S, 'DarkRed') then Result := $FF000060 else if SameText(S, 'DarkGreen') then Result := $FF006000 else if SameText(S, 'DarkYellow') then Result := $FF008080 else if SameText(S, 'DarkBlue') then Result := $FF600000 else if SameText(S, 'DarkMagenta') then Result := $FF600060 else if SameText(S, 'DarkCyan') then Result := $FF808000 else if SameText(S, 'LightGray') then Result := $FFC0C0C0 else if SameText(S, 'DarkGray') then Result := $FF606060 else if SameText(S, 'Transparent') then Result := $00000000 else Result := $FFC0C0C0; // Light Gray end; In my application, the user can select any ARGB colors using a color dialog. Now I must write the XML file for the external application and convert my ARGB colors to the name. For original values, there is no problem finding an exact match. But for other colors, undefined in the external application, I want to find the nearest color name. The alpha channel can be ignored. I tough about computing a distance between colors and pick the color name having the smallest distance. The distance could be computed considering the RGB channels as axis of a space volume where a distance in a 3-dimensional volume has a well known formula. But will this give a visually correct result ? Maybe a formula specific to color has already been designed?
  3. FPiette

    ICS Installation

    Error 9009 means "File not found".
  4. FPiette

    method for get file

    I told you to better describe your needs. Copy or CopyFile is Windows and it works whatever the physical network is between the two computers provided windows networking is running. TCP is a low level protocol that Windows Network use to implement his communication protocol (Which by the way is also implemented in Linux using SAMBA). FTP is a higher level protocol, making use of TCP to exchange files between two sites. IP address is the way to identify a computer inside a TCP/IP network. And there are many many more things that we cannot mention here (It would become a huge article). That's why you need to describe your needs.
  5. FPiette

    method for get file

    You should better describe your needs because as is the answer is very simple: copy \\share\filepath localfilepath. Copy is the command line interpreter command. You can implement it in Delphi using Windows CopyFile API (https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfile). Or using standard Defli file I/O (preferably using TFileStream).
  6. Just try to connect to each IP in the range(s) using a TWSocket. If connection succeed, disconnect and store the corresponding IP somewhere, then try the next IP. To speed up the process, you may use an array of TWSocket, each one scanning a sub-range. TWSocket is asynchronous so you don't even need to use threads.
  7. FPiette

    ICS V9.1 Highlights

    Hard work Angus! Thanks a lot.
  8. FPiette

    Hyper-V server as host for 3 VMS

    because a usb device can only be used by one machine at a time. Virtualhere presents the device on the remote machine as though it were local. I guess multiple remote PCs can connect, but only one at a given time. The connected PC must disconnect to allow another to connect. Just guessing.
  9. FPiette

    Hyper-V server as host for 3 VMS

    Only the free version is discontinued! Here is what Jeff Woolsey, Principal PM Manager at Microsoft is saying: The only thing that was discontinued was the FREE Microsoft Hyper-V Server product because we simply don’t have the time and resources to keep producing the free version. That’s it. That’s the only thing that was deprecated. [explanation skipped] In short, Hyper-V is here for the very long run.
  10. FPiette

    TPanel + Mouse

    Select both label and panel to set MouseEnter and MouseLeave event handler or assign same event handler to both components.
  11. FPiette

    Monitor Windows application and restart if needed

    In the program to be monitored, add code to make it answer to a message (for example a TCP socket or a pipe or a Windows message). Write a second program launch the first and periodically connect to the main program and check if he gets an answer. If no answer, it kills the program et start it again. When the second program starts the first (CreateProcess), it gets an handle that can be waited to catch when the program stops normally.
  12. A good architecture, scalable architecture, is to have ONE thread for the server component for a given protocol. That thread will handle all client communications (that's OK for up to one thousand clients) and unload any processing to worker threads. You can also consider splitting the application between different processes which will handle a single protocol and possibly use IPC to make those processes talk to each other if required. Having a single process doing everything is the best way to have an unstable system almost impossible to debug.
  13. This forum is not the place to discuss any issue with Indy, nor any comparison between ICS and any other socket component. If you want to discuss about other socket components go to their support channel. You are welcome to discuss about ICS here and nothing else.
  14. If you want to use ICS in threads, a good design would be to have all socket activity executed by the thread itself. If the data to be sent comes from another thread or received data must be processed by another thread, don't share the ICS component but use standard inter-thread communication techniques to do the transfert. Note that processing by ICS is not a CPU intensive process so you won't gain much using thread. Instead it is better to keep actual data processing along with the ICS component in the thread. For example, you can use a thread in a server application to handle a single client (or a few hundreds). Use ThreadAttach and ThreadDetach to move socket handling from one thread to another thread. Writing a multi-threaded application is hugely more complex than a single-threaded application, debugging is particularly difficult. You benefit from thread when computing can be done in parallel. For file transfer operation, there is almost no processing involved so benefit is low. Don't forget that the real network throughput is frequently the limiting factor. And even if you have a fast hardware speed (1Gbps for example) doesn't means that the network card you have is able to sustain such throughput.
  15. FPiette

    [MidWare] MidWare, Delphi 12

    Midware has been developed for professional projects. It has been used for more than 10 year in a large scale application having more than 700 concurrent users on a LAN. Backend database was MS-SQL server. It has also been used it many smaller applications.
  16. FPiette

    [MidWare] MidWare, Delphi 12

    Well, Midware is much, much more than a simple stream. At the highest level, it is a TDataSet and is meant to be used as middleware in a multi-tier database application.
  17. FPiette

    [MidWare] MidWare, Delphi 12

    Thank you for trying Midware. The library doesn't support Unicode nor SSL. Unfortunately, I do not maintain this library anymore. But you are welcome to update the source code and mail it to me 😉 To make it working, you has to understand how it works... It should no be too complex to update the code for SSL.
  18. FPiette

    Return value from other application

    Do you want the exe with shared for to be launched by one application each time the application needs the form? It would be quite inefficient and you'll have to manage having several instances of the form hosting application. It is possible, but will be quite complex... Instead, you can put the form inside a DLL that each application will load. Or even simpler, just compile the form's code into the 5 applications.
  19. Just run the IDE as administrator.
  20. I don't read attached text file. You must make the effort of copying the relevant part of text in your message. I won't help you except if you follow the rules and follow what I ask you to do.
  21. You first have to INSTALL the components as stated in the ReadMe file. Before components are installed, you cannot open any form having one of the component without having the error you see. You need to click CANCEL or you'll have the component removed and of course tons of problems after. Restore the unit (pas and dfm) from the zip!
  22. What error message do you get? What do you mean? You have an unfinished beta version? Remove that version and install Delphi Community Edition which is free, you just have to request it. I already told you that several times and gave you the link to request it.
  23. You ask help. We gave you advises and told you what to do. You never follow what we say. Start everything from the beginning: download ICS from the Wiki. Read and follow the ReadMe file. Read again what I previously said and follow what I (and Angus) said. Stop changing Delphi version all the time use only the latest you have.
×