Jump to content

Kryvich

Members
  • Content Count

    402
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Kryvich


  1. Yes, I can call my DLL function, no error. Library source code:

    library DllWithFmx;
    
    uses
      System.SysUtils,
      System.Classes,
      FMX.Graphics;
    
    {$R *.res}
    
    function TestDll: Integer; stdcall;
    begin
      Result := Integer(TFontWeight.Semibold);
    end;
    
    exports
      TestDll;
    
    begin
    end.

    Console app that use the DLL (the static linking is used):

    program DllUse;
    
    {$APPTYPE CONSOLE}
    
    {$R *.res}
    
    uses
      System.SysUtils;
    
    function TestDll: Integer; stdcall; external 'DllWithFmx.dll';
    
    var
      i: Integer;
    begin
      i := TestDll;
      Writeln(i);
      Readln;
    end.

     


  2. If I put a breakpoint to the line TThread.Queue(...) it gets hit twice on every button press. I think it's how the debugger works. I've added a counter and there is no any missed clicks. And no error messages on exit.

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      if not IdTCPServer1.Active then begin
        IdTCPServer1.Active := True;
        IdTCPClient1.Connect;
      end;
      Inc(ClickCount);
      IdTCPClient1.IOHandler.WriteLn(Format('Hello, world. Click #%d.',
        [ClickCount]));
    end;
    
    procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    begin
      if IdTCPServer1.Active then
        IdTCPClient1.Disconnect;
    end;
    
    procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
    var
      s: string;
    begin
      s := AContext.Binding.PeerIP + ': ' + AContext.Connection.IOHandler.ReadLn;
      TThread.Queue(nil, procedure begin Memo1.Lines.Add(s) end);
    end;

     

     

    IndyClientServer2.jpg


  3. No problem here with Indy components included in Delphi 10.3.3 package. Just change Button1Click as follows:

      if not IdTCPServer1.Active then begin
        IdTCPServer1.Active := True;
        IdTCPClient1.Connect;
      end;
      IdTCPClient1.IOHandler.WriteLn('Hello, world');

    I did not find projects IndyCore260, IndyProtocols260 etc. for the new Delphi 10.3.3 in the library on GitHub.

×