🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TIdNNTP, string data type and BCB 6

#4600
From: Remy Lebeau (TeamB)
Date: Mon, 17 Jan 2005 08:40
39 lines
2481 bytes
"Warwick" <warwickb1@extradotcodotnz> wrote in message
news:41eb3e6d@newsgroups.borland.com...

> I didn't really want the data in the Memo component, which I am
> using  for something else. But if I pass NewMessages->Strings as
> an argument instead the compiler thinks I am passing a single String
> rather than a TStrings object.

You are supposed to pass in the NewMessages object itself, not one of its
properties:

    IdNNTP1->GetNewNewsList(NewsGroups[0], dt, false, Distributions,
NewMessages);

> It is difficult to tell which argument is the one the compiler objects
> to from the error.

No, it is not.  It is very easy to figure out which paramater is wrong.
Simply look at IdNNTP.hpp to see how GetNewNewsList() is actually declared,
then compare it to the error message to see which parameter(s) do not match
the declaration.

> As you can see I mistakenly thought it was a difference between
> AnsiString and string. I thought perhaps because string is a typedef
> for basic_string in  BCB.

It is true that 'string' (lowercase 's') is such a typedef.  However,
'String' (uppercase 'S') is a typedef for AnsiString, and is provided for
compatibility with Delphi code.

> Ok, thanks. Again I was unsure which argument presented the
> problem, the pascal definition has all arguments passed by reference.

Don't look at the Pascal definitions.  Look at the C++ headers instead.
That is where the compiler is getting its information from.


Gambit
Technical Details
Message-ID: <41eb796c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41ea24b0@newsgroups.borland.com> <41eacae6$1@newsgroups.borland.com> <41eb3e6d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,af8cc131fea57133
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <41ea24b0@newsgroups.borland.com> <41eacae6$1@newsgroups.borland.com> <41eb3e6d@newsgroups.borland.com>
Subject: Re: TIdNNTP, string data type and BCB 6
Date: Mon, 17 Jan 2005 00:40:13 -0800
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41eb796c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1105951084 68.69.17.41 (17 Jan 2005 00:38:04 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail