🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1531

Re: indy ping exmaple

#1531
From: John M.
Date: Thu, 02 Dec 2004 21:39
127 lines
4635 bytes
Hi Gambit,

the Ping function need two parameters, that is why my code does not work. i
get this error messages:

[C++ Fehler] main.cpp(865): E2193 Zu wenige Parameter im Aufruf von
'_fastcall TIdIcmpClient::Ping(AnsiString,unsigned short)'

Means like "To few parameters in call of '_fastcall
TIdIcmpClient::Ping(AnsiString,unsigned short)'"

[C++ Fehler] main.cpp(866): E2288 Zeiger auf Struktur auf linker Seite
von -> oder von ->* erforderlich
[C++ Fehler] main.cpp(869): E2288 Zeiger auf Struktur auf linker Seite
von -> oder von ->* erforderlich
[C++ Fehler] main.cpp(870): E2288 Zeiger auf Struktur auf linker Seite
von -> oder von ->* erforderlich
[C++ Fehler] main.cpp(871): E2288 Zeiger auf Struktur auf linker Seite
von -> oder von ->* erforderlich
[C++ Fehler] main.cpp(872): E2288 Zeiger auf Struktur auf linker Seite
von -> oder von ->* erforderlich

Means like "Pointer of structure on the left site from -> or from ->*
necessarily


This is here is my actual code:

void __fastcall TForm1::Button2Click(TObject *Sender)
{
   AnsiString s;
   IdIcmpClient1->Ping("www.borland.com");
   switch(IdIcmpClient1->ReplyStatus->ReplyStatusType)
   {
      case rsEcho:
         s = "Reply from " + IdIcmpClient1->ReplyStatus->FromIpAddress
         + (": bytes=" +
AnsiString(IdIcmpClient1->ReplyStatus->BytesReceived))
         + (" time=" +
AnsiString(IdIcmpClient1->ReplyStatus->MsRoundTripTime) + "ms")
         + (" TTL=" + AnsiString(IdIcmpClient1->ReplyStatus->TimeToLive));
         ShowMessage(s);
      break;

      case rsError:
         ShowMessage("Request Error");
      break;

      case rsTimeOut:
         ShowMessage("Request Timed Out");
      break;

      case rsErrorUnreachable:
         ShowMessage("Host Unreachable");
      break;

      case rsErrorTTLExceeded:
         ShowMessage("TTL Exceeded");
      break;
   }

}
//--------------------------------------------------------------------------
-


Any ideas about the second parameter? I am using Indy 90017

john



"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schrieb im Newsbeitrag
news:41af5738$1@newsgroups.borland.com...
>
> "John M." <johnnym@yahoo.com> wrote in message
> news:41af0a1b@newsgroups.borland.com...
>
> > i tried this here:
>
> That code is wrong.  Did you not read Indy's documentation yet?
>
> > IdIcmpClient1->Host = "www.borland.com";
>
> You do not use the Host property.  You pass the hostname to Ping() as a
> parameter instead:
>
>     IdIcmpClient1->Ping("www.borland.com");
>
> > ShowMessage(IdIcmpClient1->ReplyStatus);
>
> ReplyStatus is a class, not a string:
>
>     switch( IdIcmpClient1->ReplyStatus->ReplyStatusType )
>     {
>         case rsEcho:
>         {
>             AnsiString s = "Reply from " +
> IdIcmpClient1->ReplyStatus->FromIpAddress
>                  + (": bytes=" +
> AnsiString(IdIcmpClient1->ReplyStatus->BytesReceived))
>                 + (" time=" +
> AnsiString(IdIcmpClient1->ReplyStatus->MsRoundTripTime) + "ms")
>                 + (" TTL=" +
> AnsiString(IdIcmpClient1->ReplyStatus->TimeToLive));
>             ShowMessage(s);
>             break;
>         }
>
>         case rsError:
>             ShowMessage("Request Error");
>             break;
>         case rsTimeOut:
>             ShowMessage("Request Timed Out");
>             break;
>         case rsErrorUnreachable:
>             ShowMessage("Host Unreachable");
>             break;
>         case rsErrorTTLExceeded
>             ShowMessage("TTL Exceeded");
>             break;
>     }
>
>
> Gambit
>
>
Technical Details
Message-ID: <41af8bb4@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.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: <41ae5b3a@newsgroups.borland.com> <41ae71eb@newsgroups.borland.com> <41af0a1b@newsgroups.borland.com> <41af5738$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,fa101c2ed92ef067
X-Google-Attributes: gidfeeec,public
X-Google-Language: GERMAN,ASCII-7-bit
From: "John M." <johnnym@yahoo.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <41ae5b3a@newsgroups.borland.com> <41ae71eb@newsgroups.borland.com> <41af0a1b@newsgroups.borland.com> <41af5738$1@newsgroups.borland.com>
Subject: Re: indy ping exmaple
Date: Thu, 2 Dec 2004 22:39:59 +0100
Lines: 129
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: 217.88.156.194
Message-ID: <41af8bb4@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1102023604 217.88.156.194 (2 Dec 2004 13:40:04 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.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