🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4287

Synchronize in Indy TIdThread

#4287
From: Roberto Zais
Date: Wed, 02 Mar 2005 17:13
75 lines
3048 bytes
I am a bit worry  : I used Synchronize() in a TThread without problems : I
defined the
procedure inside my specific  TThread class and there were no problems .
Now I do the same inside a TIdThread ( I saw some documentation: all seem to
allow it in the same way:
another chance is the syncronization class but I ' d prefer the same way.. )
but  I get the error :


[C++ Error] Unit11.cpp(105): E2285 Could not find a match for
'TIdBaseThread::Synchronize(void)'

many thanks if you can help me
ciao
Roberto

This is my code... (actually)


class TSMTPThread : public TIdThread
{
  typedef struct tagTHREADNAME_INFO
  {
    DWORD dwType;     // must be 0x1000
    LPCSTR szName;    // pointer to name (in user addr space)
    DWORD dwThreadID; // thread ID (-1=caller thread)
    DWORD dwFlags;    // reserved for future use, must be zero
  } THREADNAME_INFO;
private:
TIdMessage  *MyMsg;             // Message and  server SMTP encapsuled
                                                 // into the  thread
TIdSMTP *MyIdSMTP1;


protected:
        void __fastcall Run();
public:
        __fastcall TSMTPThread(bool CreateSuspended);
        void __fastcall Read_Edit_indirizzo_mail(void);

AnsiString MessageText,temps;
AnsiString FFrom;
AnsiString FMessage;
AnsiString FRecipient;
AnsiString FSMTPServer;
AnsiString FSubject;
};

void __fastcall TSMTPThread::Read_Edit_indirizzo_mail(void)
        {
        temps = timeinfo[turno_attuale-1].Edit_indirizzo_mail->Text;
        }

void __fastcall TSMTPThread::Run()
{
//@@@  Run e' eseguito CONTINUAMENTE finche' non c'e' una unhandled
exception)

if( sendmail_flag == true)
        {
        try{                            // si tenta il setup del modulo
TDIMessage

        MyMsg->Clear();
        MyMsg->CharSet = "Windows-1251";
/* ALL to synchronize...
        MyMsg->From->Name =  Form13->Edit1->Text;
        MyMsg->From->Address = Form13->Edit2->Text;
        MyMsg->Sender->Name =  Form13->Edit3->Text;
        MyMsg->Sender->Address =  Form13->Edit4->Text;
*/
// first try :
        Synchronize(Read_Edit_indirizzo_mail);          //<--!!!!!
compilation ERROR
       (...........)
Technical Details
Message-ID: <4225f42a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c27f0c18631b8711,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Roberto Zais" <rzaiss@tiscali.it>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Synchronize in Indy TIdThread
Date: Wed, 2 Mar 2005 18:13:29 +0100
Lines: 78
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 212.171.10.198
Message-ID: <4225f42a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1109783594 212.171.10.198 (2 Mar 2005 09:13:14 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail