Article View: borland.public.cppbuilder.internet.web
Article #233Re: WebBrowser Navigate Post problems!
From: Remy Lebeau (TeamB)
Date: Tue, 07 Aug 2007 17:20
Date: Tue, 07 Aug 2007 17:20
42 lines
2386 bytes
2386 bytes
"Mischa Simmonds" <mischa1.BanSpam@informationdesign.BanSpam.com.au> wrote
in message news:46b87478$1@newsgroups.borland.com...
> My code is something like this...
That code shouldn't even be able to compile, let alone run. Each of the
parameters of TCppWebBrowser::Navigate2() expect a pointer to a TVariant,
but you are not constructing any TVariant instances at all. And it is also
unclear whether you are actually trying to call the
TCppWebBrowser::Navigate2() method or the IWebBrowser2::Navigate2() method,
for that matter.
Try this instead:
AnsiString asPostData = "name=Mischa&Country=Australia";
LPSAFEARRAY psa = SafeArrayCreateVector(VT_UI1, 0, asPostData.Length());
if( psa )
{
void *pvdata = NULL;
SafeArrayAccessData(psa, &pvdata);
memcpy(pvdata, asPostData.c_str(), asPostData.Length());
SafeArrayUnaccessData(psa);
TVariant vPostData(psa);
TVariant vURL = AnsiString("http://www.somewhere.com");
TVariant vContentType = AnsiString("Content-Type:
application/x-www-form-urlencoded\r\n");
CppWebBrowser->Navigate2(&vURL, TNoParam(), TNoParam(), &vPostData,
&vContentType);
}
> I have ... also tried to use the ideas expressed in
> http://dn.codegear.com/en/article/27519 but get the same result.
The code you showed is not doing anything that article says to do.
Gambit
Technical Details
Message-ID:
<46b8a9f1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46b87478$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,f3fb23a392722ed0 X-Google-Attributes: gidfeeec,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.web References: <46b87478$1@newsgroups.borland.com> Subject: Re: WebBrowser Navigate Post problems! Date: Tue, 7 Aug 2007 10:20:23 -0700 Lines: 44 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: 75.83.29.61 Message-ID: <46b8a9f1$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1186507249 75.83.29.61 (7 Aug 2007 10:20:49 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail