indy Activex Thread issues

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
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 »

The point is, please look other project.
Animation for only to remember you which forum thread that is.
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 »

i take time to look at your project , your project is perfect but there is a problem iam not good with xml parsing ,, reason that i want to use my project because i use very simple protocol to send and receive commands example

Kod: Tümünü seç

sendcommandwithparams(client, 'command', anything i want to send + ~); and i can use its as Params[1] to recive
, its so simple than parsing xml i will unable to combine this with your projects
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

I see. Thank you. It was just education purposes.
Good to hear that problem has been solved.
Have a good work.
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 mrmarman you dont know how many time i spend before to get this activex thread working ,, still have some bugs , is there other ways to synchronize instead from using tmemo or tstring ? i mean in this code

Kod: Tümünü seç

procedure Ttestthreading.Memo1Change(Sender: TObject);
begin
  // '~' means EndOfTransAction for transaction. I decided it myself, not a common thing.
  if Pos('~', Memo1.Lines.Text ) > 0 then
  begin
    // Synchronized / Incoming Message Event is Here...
    ProcessCommands( Memo1.Lines.Text );
    Memo1.Lines.Clear;
  end;
end;


before i was syncronize like this

Kod: Tümünü seç

ProcessCommands(Command);
  Command := '';
because this always will delete the tmemo and old text will not showing when i try to change synchronize stops from working its also visible the command to the users in received memo
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

Try to use another new tmemo for onchange event usage.
I explained a couple messages ago above.
Don't be forget about to change memo1 to memo2 on thread creation process.
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 »

do i have to use changememo event to get it work ? do i have to use tmemo at all ? why i canot use only command string variable
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

You need a thread for messaging and an event for gathering that messages from thread side to main form place.
That is why to use a dummy vcl.
In my methodology, I usually use TMemo. You may use any vcl that exists onchange event or like that.
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 »

i try other tmemo as you said i dont know why its showing the command in the other memo
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

Please give me name, which is what? Let's we found the issue by tracinh the source code
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 »

here is the project and what i did

http://www.mediafire.com/download/e65gh ... marman.rar

i removed mMessage.Text := Command; from command process to solve this command showing in other memo

i dont know still how command be sorted in memo1 how command added in memo1 onchange event if there is no refrence to add any command there ?

tell me if i did something wrong in my project also i removed ~ because i alread have SEP to define EndOfTransAction but why when i removed this
En son mia tarafından 29 Nis 2015 04:46 tarihinde düzenlendi, toplamda 2 kere düzenlendi.
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

:roll: Downloaded and see that, you don't read my writings.
Please look at this.

Kod: Tümünü seç

procedure Ttestthreading.TCPClientConnected(Sender: TObject);
begin
  ListeningThread := TReadingThread.Create( TCPClient, Memo1.Lines );
  SendCommandWithParams(TCPClient, 'LOGIN', edPass.Text  + Sep);
end;
I said before many times ; add new memo and don't be forget what?
Memo1.lines don't you see?

Thread returns value with this.
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 »

i already added new memo called Mmessege ,, also why when i remove this line from process command its stop from working ? and also how the command sorted into memo1 ?

Kod: Tümünü seç

Command := Trim(StringReplace( Command, '', '', [rfReplaceAll])); 
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

just check it out.
change this

Kod: Tümünü seç

ListeningThread := TReadingThread.Create( TCPClient, Memo1.Lines );
to this

Kod: Tümünü seç

ListeningThread := TReadingThread.Create( TCPClient, Mmessege.Lines );
and sit back and watch what's going...
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 »

i get lag after i did that , also how the command stored in memo ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

then copy and paste code from Memo1's OnChange event to the Mmessege's onChange event. This will take the transaction from Memo1 to the Mmessege.
Resim
Resim ....Resim
Cevapla