Jump to content

ChrisChuah

Members
  • Content Count

    121
  • Joined

  • Last visited

Posts posted by ChrisChuah


  1. Hi 

    Last time, since Delphi 6, i managed to download an VNCX.dll from internet and i was able to embed it into my Delphi 6 application.

    Now, i tried to import this same component into Delphi 11, Delphi 11 managed to convert into the TLB files and was able to compile it and add to the Palette.

    When i create a new Windows VCL app and add that VNC ActiveX component into the form, Delphi 11 will crash.

    Is there a way to find out why Delphi 11 crashed?

     

    regards

    chris

     


  2. Hi Remy

    The data sent to 2 ports are different. The server was designed in such a way that Port1 is sending Command and Control data while Port2 is used for sending and receiving Configuration data.

    That was how the server was implemented long time ago.

    Since both ports will be getting data from the server at any 1 time so i cant just use 1 client to send and receive from 2 different ports at the same time isnt it?

    Am i able to use 1 idTCPClient port to connect to 2 ports? once connected, both ports can receive data at the same time?

    please advise

     

    regards

    chris

     


  3. Hi Remy

     

    Now i m having another problem

    In my app, i have 2 idTCPClient sockets that connect to 2 different ports of same server application.

    When one of the port or idTCPClient (Client A) disconnect, it should disconnect the other idTCPClient (Client B) as there may be some issues with the server app.

    When reconnecting the idTCPClient B to the server, whenever i try to use ClientB.IOHandler.Read, it will give me an exception like this

    -----

    <07/11/2023 10:02:31> IP to Connect to CM: 172.20.11.9:16194
    <07/11/2023 10:02:31> Connecting..CM User TCP: 172.20.11.9:16197 Own IP: 172.20.13.201
    <07/11/2023 10:02:36> Error in Thread Run. Type: EIdConnClosedGracefully Msg: Connection Closed Gracefully.
    -----

    When disconnecting idTCPClient B, should i release the IOHandler? 

    If not how can i handle this exception as I am using a IdThreadComponent to read the IdTCPClient B socket for messages

     

    regards

    chris

     


  4. Hi

    Is there a way to use Indy TCP Client to have a synchronous method whereby 

    IdTCPClient1.Connect;

    IdTCPClient1.Send();

    IdTCPClient1.Disconnect

     

    rather than to wait for OnConnect event to send the message and followed by Disconnect as I would need to put the buffer on queue so that it will be written to the socket onConnect event

    The reason for doing this is that i need to send multiple message to different TCP servers and they will accept one command and need to disconnect after sending.

    What would be the best way to implement this?

     

    please advise

    regards

    chris

     


  5. Hi

    I have another question.

    For Windows x86 and x64, we will need to copy the webview2load.dll to the app directory.

    How about linux? what are the files that i need to copy or attach to my app directory?

    The windows webview2load.dll is found in C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win64 for 64bit deployment and C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\win32 for 32bit deployment.

    Do i attached the entire C:\Program Files (x86)\Embarcadero\Studio\22.0\Redist\linux64 directory files when i deploy for linux when using TWebBrowser in Linux?

     

    please advise

     

    regards

    chris

     


  6. hi, 

    i am using the Twebbrowser component to load a page which i can see it from microsoft edge and chrome

    but it was not able to be displayed on the TWebbrowser.

    Any ideas on how to debug it. i think its still using IE but i am trying to use EdgeIfAvailable but Edge engine is not found if i set the EdgeOnly option

    where can i find the webview2loader.dll? i downloaded the Evergreen standalone as well as the Fixed version. Expanded the Fixed version but cant find this file

     

    regards

    chris


  7. The TControlSizer made by http://www.simes.clara.co.uk/delphi/ctrlsize.htm no longer exists.

    Is there a replacement for it to work on Delphi 11?

    Its still working under Delphi 6 but somehow due to it using windows messages lparams, it is currently not working now

     

    regards

    chris

     

    === From the Delphi Groups ======

    Here are a few URLs you may want to check out:

     TStretchHandle         http://www.torry.ru/index.htm, at the Authors's
    page under S for Scott, Anthony.
     TControlSizer          
    http://community.borland.com/homepages/dsp/index.htm

    http://www.simes.clara.co.uk/delphi/ctrlsize.htm
          DDH by Marco Cantu has an example,
          download DDh3Code.zip from
          http://www.marcocantu.com/ddh/default.htm
          Part II, Chapter 8 "Advanced Window Components",
          DdhSizer.pas. And how to use it ..\SizeComp\SizeDemo.dpr.
    TSizeControl   http://rpi.net.au/~ajohnson/delphi/

    --
    Peter Below (TeamB)  
    Use the newsgroup archives :
    http://www.mers.com/searchsite.html
    http://www.tamaracka.com/search.htm
    http://groups.google.com
    http://www.prolix.be

     

     

  8. Hi

    Is there a ActiveX or native component for VNC Client or Remote Desktop client so that the application can connect to the VNC server running on Ubuntu 22 and above.

    The VNC ActiveX component that i have been using since Delphi 6 is not able to properly show the Ubuntu desktop version 22. But it is able to display properly for Ubuntu 20.

     

    Please advise

     

    regards

    chris


  9. Hi

    I have a local web page which i will use the FMX.TWebBrowser for Linux to call

    e.g. File:///home/chris/webpage.html

    In this web page, there is a java script that will read the xml in that /home/chris directory

    However, the web browser is unable to read the xml due to CORS

    Is there a way to allow the FMX.TWebBrowser to enable the javascript to read the local xml file or how to disable the CORS?

     

    regards

    chris

     


  10. Hi

    So sorry to cause so much of confusion.

    Currently, i am running MacOS Monterey with XCode 14.2, PAServer 13.1.11

    Actually, if i were to upgrade the MacOS from Monetery to Ventura, while keeping the PAServer for Delphi 11.1 at 13.1.11 and XCode  14.2, would there be any problem to compile and run a FMX application for MacOS?

    Previously i had a problems after upgrading the XCode or MacOS, Delphi would not be able to compile and run the fmx application for iOS or MacOS.

    I am now stuck with Delphi 11.1 as the company may not want to continue with using Delphi further due to not able to find programmers with such skills locally.

    Everyone is onto newer programming languages such as javascript, Ruby, Rust, C sharp etc.

    So sorry to say (what i feel) that delphi is really on a decline whereby the number of components released in 2008 and now, its not easy to find a suitable component for delphi.

     

    Hence maybe i am stuck in the middle whereby i may need to re-write some of my apps into other programming languages such as Java or ReactJS

     

    regards

    chris

     

     

     

     

    Screen Shot 2023-03-30 at 9.30.37 AM.png


  11. Hi

    Currently i running Delphi 11.1 in Windows 10 VM. The VM is running on MacOS Monterey 12.6.3

    With Delphi 11.1, i am still able to compile MacOS app to run on Monterey.

    However, if i were to upgrade my MacOS to Ventura, Will my Delphi 11.1 able to compile MacOS app for Ventura?

    I dont want to face the fact that after i upgraded my MacOS from Monterey to Ventura and Delphi 11.1 cannot compile for MacOS, iOS and Android via PAServer.

     

    regards

    chris


  12. I agree with you. It is really a headache when dealing with Thread and synchronisation.

    In Indy TCP component, i need to use the Thread component to read the TCP socket constantly for data.

    When there is data, need to append to a buffer or memstream as network data does not come in nice chunk of data with start and end.

    Then we need to process that memstream for the appropriate data and remove the part of the data process from the memstream and add to another queue or List.

    Then we need to create another thread to process this List to send out events. Need to create the thread so that it will hog up the first thread that read data from the TCP component.

    In this processing thread, need to fire event based on the message. 

    In this event, if there is a need to update the Main form UI, we need to use the TThread.Synchronize or TThread.Queue. If I were to update the data in memory, then i would not need to use TThread isnt it? <== Am i on the correct path?

     

    So, if i update the data in memory and i use the timer to refresh the Main form UI, Do i still need to use TThread.Synchronize or TThread.Queue?

    But using System.TTimer to refresh the data would have a lower priority in refreshing as if there are lots of data coming in on the TCPClient, the updates would use up the CPU and the timer will be set back to later time when the CPU is less busy isnt it?

     

    Please advise

     

     


  13. Hi remy

    Ignore my last statement on the TThread.Queue can be called by Clipboard event. I am still trying to figure out why my application UI can hang or irresponsive when there is a large amount of data is received from the TidTCPClient. The TidThreadComponent will be busy processing and send out events to the MyEvent function as shown below 

     

    TMainForm.MyComponentMyEvent(Sender : TObject; aData : string)

    begin

      TThread.Synchronize (nil, procedure

      begin

        // update the FMX Form UI button, grid etc.

      end);

    end;

     

    My app is then reported by windows task manager that it is not responding.

    How can i check where  the problem lies? Is it at the TThread.Synchronized  in the MyComponentMyEvent? I cannot click on any part of the application UI anymore.

    This is an FMX application running in Windows 32 bit. Would I not face any of this hanging issue if i change to a VCL application instead of FMX?

     

    Please advise

    regards

    Chris

     


  14. Hi

     

    I have a component like this

     

    TMyComponentEvent = procedure (Sender : TObject ; aData : string) of object;

    TMyComponent = class(TComponent)

    private

      FClient : TidTCPClient;

      FProcessList : TmyStringList;

      FReadThreadComponent : TidThreadComponent;

      FProcessThreadComponent : TidThreadComponent;

     

      FOnMyEvent : TMyComponentEvent;

      procedure DoMyEvent(aData : string); dynamic;

    ...

    ...

      procedure ReadThreadComponentRun(Sender : TidThreadComponent)

      procedure ProcessThreadComponentRun(Sender : TidThreadComponent)

    ..

    ..

    published

      property OnMyEvent : TMyComponentEvent read FOnMyEvent write FOnMyEvent;

    end;

     

    procedure register;

    begin

      RegisterComponents('MyComponents', [TMyComponent]);

    end;

     

    // cc : the UI screen will have this component and will have a set of code

    // cc : to implement on this event

    procedure TMyComponent.DoMyEvent(aData : string);

    begin

      if assigned(FOnMyEvent) then

      FOnMyEvent(self, aData);

    end;

     

    // cc : assume that the TidTCPCLient is connected to the server

    // cc : so the FReadThreadComponent will always get the data from TidTCPClient

    procedure TMyComponent.ReadThreadComponentRun(Sender :TidThreadComponent)

    var

      l_readBytes : TIdBytes;

      l_processdata : string;

    begin

      FClient.IOhandler.ReadBytes(l_ReadBytes, -1, false);

      if length(l_readBytes) = 0 then exit;

      {There are some headers to remove from the l_readBytes 

      l_processData := ProcessidBytes(l_readBytes);

      FProcessList.add(l_processData);

    end;

     

    // cc : this is another idThreadComponent that will take the first item from the myStringList

    // cc : and process it

    procedure TMyComponent.ProcessThreadComponentRun(Sender : TidThreadComponent);

    var

      l_data : string;

    begin

       // cc : take the first item from the MyStringList

      l_data := FProcessList.getFirstData;

      if (l_data[1] = '1') then

        DoMyEvent(l_data);

    end;

     

    In the main form

     

    TMainForm.MyComponentMyEvent(Sender : TObject; aData : string)

    begin

      TThread.Synchronize (nil, procedure

      begin

        // update the FMX Form UI button, grid etc.

      end);

    end;

     

    Now, the question is, if i DO NOT use the TThread.Synchronize, there will be problem updating the UI grid etc.

    What is the difference if i use the TThread. Synchronize and TThread.Queue

     

    Somehow, if i use the Synchronize function, it is slower in updating the UI than TThread.Queue.

    How can i make the UI updating more responsive?

    Am i doing it correctly or can anyone advise?

     

    Also there is some hanging issue whereby the function using the TThread.Queue can be called by Clipboard event. Maybe i will need to capture that event screen again

     

×