Re: BCB Beginner

Giganews Newsgroups
Subject: Re: BCB Beginner
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Wed, 4 Feb 2004

"Bill Holt" <bi…@itsound.demon.co.uk> wrote in message
news:B39DC821B290E240bi…@itsound.demon.co.uk...

> TList *List1 = (TList*)(tcpServer->Threads->LockList());

You don't need to cast, LockList() returns a TList pointer:

    TList *List1 = tcpServer->Threads->LockList();

>    TIdPeerThread(List1->Items[X])->Connection->WriteLn(Msg);

That is the Delphi way to cast the pointer returned by Items[].  It is not
the C++ way.  It should be this instead:

    ((TIdPeerThread*)(List1->Items[X]))->Connection->WriteLn(Msg);

Or if you want real C++:

    static_cast<TIdPeerThread*>(List1->Items[X]))->Connection->WriteLn(Msg);

Gambit

Replies

None

In response to

BCB Beginner posted by Bill Holt on Wed, 4 Feb 2004