Article View: borland.public.cppbuilder.internet.socket
Article #4286Indy TIdThread Synchronization
From: Roberto Zais
Date: Wed, 02 Mar 2005 16:35
Date: Wed, 02 Mar 2005 16:35
74 lines
3047 bytes
3047 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 (_fastcall *)())'
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:
<4225eb48@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.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-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,eec54161ee9788ce,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: Indy TIdThread Synchronization Date: Wed, 2 Mar 2005 17:35:25 +0100 Lines: 76 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: <4225eb48@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1109781320 212.171.10.198 (2 Mar 2005 08:35:20 -0800) Path: arc1-ca.pugleaf.net!g2news1.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