Article View: borland.public.cppbuilder.internet.socket
Article #1800Re: console ping example
From: Michel Leunen
Date: Sun, 29 Oct 2006 16:50
Date: Sun, 29 Oct 2006 16:50
32 lines
2121 bytes
2121 bytes
DeKayA@bellsouth.net wrote: > Perhaps I started the project wrong in BCB4. > I selected New\Consoile Wizard. Is that wrong for a plain console App? Yes, see my other post. You must create a windows application instead. Your other choice is to replace the WinMain() by a main() function and the create a console application. > > I would like to provide it with an IP address or computer name on my > local net instead of the "WWW.Microsoft.com" You can pass arguments to a Windows application as well. > I know this program uses the function > phostent = gethostbyaddr((char *)&d,4,PF_INET); > But how would you convert 192.168.1.3 to ? I don't have the winsock help file at hand but look at the HOSTENT structure members. I think there is a member giving you the dotted address IIRC. Michel -- ---------------------------------------- Michel Leunen mailto: see my homepage. C++Builder, BCC5.5.1 Web site: http://www.leunen.com/ ----------------------------------------
Technical Details
Message-ID:
<4544dbbd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<45440dc2.34466740@forums.borland.com> <4544818b$1@newsgroups.borland.com> <4544a862.2476000@forums.borland.com> <4544b397.5344785@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,31ea45a742d03588 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 29 Oct 2006 17:50:12 +0100 From: Michel Leunen <nospam@noreply.be> Organization: www.leunen.com User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: console ping example References: <45440dc2.34466740@forums.borland.com> <4544818b$1@newsgroups.borland.com> <4544a862.2476000@forums.borland.com> <4544b397.5344785@forums.borland.com> In-Reply-To: <4544b397.5344785@forums.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.247.90.89 Message-ID: <4544dbbd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1162140605 81.247.90.89 (29 Oct 2006 08:50:05 -0700) Lines: 32 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail