Article View: borland.public.cppbuilder.internet.socket
Article #4801Re: Code problem
From: Hans Galema
Date: Thu, 16 Dec 2004 21:49
Date: Thu, 16 Dec 2004 21:49
52 lines
2815 bytes
2815 bytes
Maurice wrote:
> ... In my header file, on the lines
>
> __fastcall TForm1::TForm1(TComponent *AOwner)
> : TForm(AOwner);
> __fastcall TForm1::~TForm1();
The header file of which unit-cpp file ?
If you make a new form ( File - New Form ) then you will see in
the accompaniing h file for instance:
class TForm8 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TForm8(TComponent* Owner);
};
So the constructor of a derived TForm is (in its class) declared as
__fastcall TForm8(TComponent* Owner);
Now if you look in the cpp file you will see:
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
The errors you have might indicate that you just have in the h file:
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner);
outside a class definition.
That is not the way to do it.
Please show more of your h file.
If you want to use Remy's code all you have to do is:
Take a TForm. Place a TClientSocket on it. With the Object
Inspector generate eventhandlers. At least the one
for OnRead. Well OnRead() we discussed already today.
All the other code that Remy posted that day you can just
paste to the cpp file for your form. Paste it above the
OnRead eventhandler so you don't need forward declarations then.
That's all.
Hans.
Technical Details
Message-ID:
<41c20320$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!t-online.de!news.zanker.org!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41bf1302$1@newsgroups.borland.com> <41c15538$1@newsgroups.borland.com> <41c17007$1@newsgroups.borland.com> <41c179e0$1@newsgroups.borland.com> <41c19ce0@newsgroups.borland.com> <41c1a13b@newsgroups.borland.com> <41c1ff3a@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,29bbb0e4385845fe X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 16 Dec 2004 22:49:58 +0100 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: Code problem References: <41bf1302$1@newsgroups.borland.com> <41c15538$1@newsgroups.borland.com> <41c17007$1@newsgroups.borland.com> <41c179e0$1@newsgroups.borland.com> <41c19ce0@newsgroups.borland.com> <41c1a13b@newsgroups.borland.com> <41c1ff3a@newsgroups.borland.com> In-Reply-To: <41c1ff3a@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 129.125.201.248 Message-ID: <41c20320$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103233824 129.125.201.248 (16 Dec 2004 13:50:24 -0800) Lines: 52 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!t-online.de!news.zanker.org!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail