🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TCppWebBrowser doesn't return XML page ?

#1674
From: Peter
Date: Wed, 25 Aug 2004 09:42
58 lines
3234 bytes
One more thing,
I'm also POSTing data to the url in question !
Can this be done with this code as well ?


-------------------------------------------------------------
"Peter" <Peter@Smart-Projects.net> wrote in message
news:412c5869$1@newsgroups.borland.com...
> 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: <412c5ec0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4127a516$1@newsgroups.borland.com> <opsc8ticwebvaws7@dk-tzx09ucg42z4.s1.sol1.co.uk> <412c5869$1@newsgroups.borland.com>

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> <412c5869$1@newsgroups.borland.com>
Subject: Re: TCppWebBrowser doesn't return XML page ?
Date: Wed, 25 Aug 2004 11:42:13 +0200
Lines: 60
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: <412c5ec0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1093426880 213.119.36.62 (25 Aug 2004 02:41:20 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail