Article View: borland.public.cppbuilder.internet.socket
Article #136Hair 0, Indy10 1
From: Gene Buckle
Date: Fri, 30 May 2008 21:10
Date: Fri, 30 May 2008 21:10
47 lines
2112 bytes
2112 bytes
I'm trying to use TIdTCPClient directly and not in association with any form.
I'm using (or trying to) it within another class.
My class constructor goes something like this:
void __fastcall classSimulator::InitCommSystem() {
busy = true;
TCPClient = new TIdTCPClient(this);
IOHandler = new TIdIOHandlerStream(NULL);
TCPClient->IOHandler = IOHandler;
TCPClient->OnDisconnected = MainForm->DisconnectHandler;
busy = false;
}
Now the line:
TCPClient = new TIdTCPClient(this);
Dies during compile because "Could not find a match for TIdTCPClient::
TIdTCPClient(classSimulator* const)", which is perfectly reasonable.
That's why I'd changed it from "this" to NULL like the IOHandler below it.
Now while calling it with (NULL) compiles, it doesn't actually appear to work.
When I do this:
TCPClient->Host = "localhost";
TCPClient->Port = 5500;
and then
ShowMessage(TCPClient->Host);
The dialog shows nothing.
I can call TCPClient->Connect() and get no exception, yet
TCPClient->Connected() returns false.
Calling TCPClient->IOHandler->Connected() (or anything else under
TCPClient->IOHandler) just pitches an access violation exception.
What do I need to do in order to make this thing work?
thanks all
g.
--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
Technical Details
Message-ID:
<48406d41@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,9339fc05f2f275c,start
X-Google-Attributes: gid11508e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Message-ID: <48406d41@newsgroups.borland.com>
From: Gene Buckle <geneb@grumble.deltasoft.com>
Subject: Hair 0, Indy10 1
Newsgroups: borland.public.cppbuilder.internet.socket
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.23.15-80.fc7 (i686))
NNTP-Posting-Host: 199.254.199.46
Date: 30 May 2008 14:10:25 -0700
X-Trace: newsgroups.borland.com 1212181825 199.254.199.46 (30 May 2008 14:10:25 -0700)
Lines: 47
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail