indy Activex Thread issues

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: indy Activex Thread issues

Mesaj gönderen mia »

yes memo storing command , but how ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: indy Activex Thread issues

Mesaj gönderen mia »

also why when i make the memo not visible the application lagging too much ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4740
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: indy Activex Thread issues

Mesaj gönderen mrmarman »

Hi again...

I downloaded your project, done some changes.
Client project attached this message...

Just do search below text in the source.

Kod: Tümünü seç

// --- Changed begin --- //
between

Kod: Tümünü seç

// --- Changed end   --- //
There is no reasonable thing I found.

So do you have more question, go ahead from this point.

Kod: Tümünü seç

procedure Ttestthreading.TCPClientConnected(Sender: TObject);
begin
// --- Changed begin --- //
  ListeningThread := TReadingThread.Create( TCPClient, ReceivedMemo.Lines );
// --- Changed end   --- //
  SendCommandWithParams(TCPClient, 'LOGIN', edPass.Text  + Sep);
end;

Kod: Tümünü seç

procedure Ttestthreading.FormShow(Sender: TObject);
begin
  Memo1.Clear;
// --- Changed begin --- //
  ReceivedMemo.Clear;
  ReceivedMemo.Visible := False;
// --- Changed end  --- //
end;

Kod: Tümünü seç

// --- Changed begin --- //
  Command := Trim(Command);
// --- Changed end  --- //
The reason of lagging may be this section

Kod: Tümünü seç

// --- Changed begin --- //
procedure Ttestthreading.ReceivedMemoChange(Sender: TObject);
begin
  // Synchronized / Incoming Message Event is Here...
  if ReceivedMemo.Text <> '' // two lines later we do not want to trigger again with cleartext...
    then ProcessCommands( ReceivedMemo.Lines.Text );
  ReceivedMemo.Lines.Clear;
end;
// --- Changed end   --- //
Dosya ekleri
client.rar
(14.33 KiB) 188 kere indirildi
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: indy Activex Thread issues

Mesaj gönderen mia »

You are awesome Thank you very much , one thing left to understand every thing how possibly command added to ReceivedMemo ? i mean how its add the sended commands ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4740
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: indy Activex Thread issues

Mesaj gönderen mrmarman »

Thank you
@mia yazdı: one thing left to understand every thing how possibly command added to ReceivedMemo ? i mean how its add the sended commands ?
- I designed that thread class with this capability by adding a property named FLogResult.
- FLogResult is a TStrings property. When you create this thread by setting by a Memo's TStrings property ( here Memo.Lines property ) thats pointer automatically ties to the inside the thread.
- When thread makes changes to the FLogResult, at same time this changing value triggers the Memo's OnChange event.
- We can catch this text by this event so.

Kod: Tümünü seç

  type
  TReadingThread = class(TThread)
  protected
    FConnection  : TIdTCPConnection;
    FLogResult   : TStrings;
    procedure Execute; override;
  public
    constructor Create(AConn: TIdTCPConnection; ALogResult: TStrings); reintroduce;
  end;

Kod: Tümünü seç

  ListeningThread := TReadingThread.Create( TCPClient, ReceivedMemo.Lines );
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: indy Activex Thread issues

Mesaj gönderen mia »

you are a genius , you cannot imagen how much time i spend about 1 year to find an equation and solve the problem and here you are you solve every thing ,, i hope that i know this forums from many years , iam really thankful to know such a guy like you Thank you Mrmarman to make life easy and understandable . Solved
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4740
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: indy Activex Thread issues

Mesaj gönderen mrmarman »

Thank you, with my pleasure. :D
I enjoyed to work with this project. You also been helpful for forum, that the forum also needs this example.
:bravo:
Resim
Resim ....Resim
thuyyeu99
Üye
Mesajlar: 1
Kayıt: 13 Ara 2018 11:20

Re: indy Activex Thread issues

Mesaj gönderen thuyyeu99 »

Dead link
Please Update link download OCX activex. Thank you
master_crazy
Üye
Mesajlar: 17
Kayıt: 09 Eyl 2016 11:57

Re: indy Activex Thread issues

Mesaj gönderen master_crazy »

Lütfen arşivleri tekrar güncelleyin.
Vakit ayırdığınız için teşekkürler!
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4740
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: indy Activex Thread issues

Mesaj gönderen mrmarman »

Resim
Resim
Resim ....Resim
Cevapla