🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TCppWebBrowser doesn't return XML page ?

#1673
From: Peter
Date: Wed, 25 Aug 2004 09:15
46 lines
2821 bytes
Thanks
Unfortunately I can't check this out anymore, a trip abroad has been pulled
in, I will check it out in two weeks !

-------------------------------------------------------------
"Mark Jacobs" <markjattycriticaldottycodottyuk> wrote in message
news:opsc8ticwebvaws7@dk-tzx09ucg42z4.s1.sol1.co.uk...
On Sat, 21 Aug 2004 21:37:41 +0200, Peter <Peter@smart-projects.net> wrote:

> I works 'nicely' for txt or html files with various content but the
> moment
> the first line says :  <?xml version="1.0" ?> it doesn't work.

unsigned long mjgeturlconts(AnsiString url,AnsiString fnm)
{
   char *bfr; unsigned long nmbyts=0,ba,br=1; FILE *fp;
   HINTERNET
hss=InternetOpen("WhateverApp",INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
   if (!hss) { ShowMessage("Could not Open Internet Session"); return 0;}
   HINTERNET hsv=InternetOpenUrl(hss,url.c_str(),NULL,0,0,0);
   if (!hsv) { ShowMessage("Could not Open Service "+url);
InternetCloseHandle(hss); return 0;}
   InternetQueryDataAvailable(hsv,&ba,0,0);
   if (ba==0) { ShowMessage("No Data Available at "+url);
InternetCloseHandle(hss); return 0;}
   bfr=(char *)malloc((ba+9)*sizeof(char));
   if (!bfr) { ShowMessage("Not Enough Memory - "+AnsiString(ba+9));
InternetCloseHandle(hss); return 0;}
   fp=fopen(fnm.c_str(),"wb");
   if (!fp) { ShowMessage("Could not Open File "+fnm); free(bfr);
InternetCloseHandle(hss); return 0;}
   while (br!=0) { InternetReadFile(hsv,bfr,ba,&br);
fwrite(bfr,sizeof(char),br,fp); nmbyts+=br;}
   fclose(fp); InternetCloseHandle(hss); hss=NULL; free(bfr);
   return nmbyts;
}

url is the url you are trying to get whatever from, and fnm is the name of
the file you want to store it in.

HTH
-- 
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
markj atty critical dotty co dotty uk
Technical Details
Message-ID: <412c5869$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4127a516$1@newsgroups.borland.com> <opsc8ticwebvaws7@dk-tzx09ucg42z4.s1.sol1.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,7498d8e04b8d308a
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Peter" <Peter@Smart-Projects.net>
From: "Peter" <Peter@Smart-Projects.net>
Newsgroups: borland.public.cppbuilder.internet.web
References: <4127a516$1@newsgroups.borland.com> <opsc8ticwebvaws7@dk-tzx09ucg42z4.s1.sol1.co.uk>
Subject: Re: TCppWebBrowser doesn't return XML page ?
Date: Wed, 25 Aug 2004 11:15:10 +0200
Lines: 48
Organization: www.Smart-Projects.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 213.119.36.62
Message-ID: <412c5869$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1093425257 213.119.36.62 (25 Aug 2004 02:14:17 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail