Article View: borland.public.cppbuilder.internet.web
Article #358Re: submit cppwebbrowser
From: Amidala
Date: Sun, 10 Dec 2006 09:54
Date: Sun, 10 Dec 2006 09:54
87 lines
3622 bytes
3622 bytes
hi remy,
could you give me one example how to use it properly?
i tried myself now with this here, but i had no success.
IHTMLDocument2 *HTMLDocument = NULL;
if(SUCCEEDED(CppWebBrowser1->Document->QueryInterface(IID_IHTMLDocument2,
(LPVOID*)&HTMLDocument)))
{
IHTMLElementCollection *HTMLForms = NULL;
if(SUCCEEDED(HTMLDocument->get_forms(&HTMLForms)) && HTMLForms)
{
// form name
TVariant vName = "Form1";
TVariant vIndex = 0;
IDispatch *pDisp = NULL;
if(SUCCEEDED(HTMLForms->item(vName, vIndex, &pDisp)) && pDisp)
{
IHTMLElement *pElement = NULL;
// submit image name
TVariant vName2;
VariantInit(&vName2);
vName2.vt = VT_BSTR;
vName2.bstrVal =
WideString("LeftContainer:FormQuickSearch:btnSubmit").Detach();
TVariant vIndex2 = 0;
if(SUCCEEDED(HTMLForms->item(vName2, vIndex2, &pDisp)))
{
pDisp->QueryInterface(IID_IHTMLElement, &pElement);
pDisp->Release();
}
if(pElement)
{
pElement->click();
pElement->Release();
}
pElement->Release();
}
}
}
amidala
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schrieb im Newsbeitrag
news:457ba45e$1@newsgroups.borland.com...
>
> "Amidala" <no-spam@tiffie.net> wrote in message
> news:457b1654@newsgroups.borland.com...
>
>> i tried this code, but in my case it didn't work.
>
> Why not? Please be more specific. The code I posted earlier works just
> fine to submit forms. I applied it to this situation and it still worked
> fine. So you are probably just not using it properly.
>
>> the site reloads
>
> If you pay attention to what that website is actually doing, you have to
> agree to a separate Disclaimer form before you can reach the actual
> information page. The same thing happens when you navigate to that
> website
> using a normal web browser..
>
>> when i klick that form by myself, there appears another site with the
> information i looked for.
>
> Worked fine for me after I agreed to the disclaimer.
>
>> is there no way to let this submit work the same as a mouse klick?
>
> That is exactly what the IHTMLFormElement::submit() method does. You are
> just not submitting enough forms to actually reach the page you are
> wanting.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<457bd937@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!newsfeed.freenet.de!news.albasani.net!feeder06.uucp-net.de!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mailReferences:
<457aeae7@newsgroups.borland.com> <457afe08@newsgroups.borland.com> <457b1654@newsgroups.borland.com> <457ba45e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,a854b31ad8a3f21 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Amidala" <no-spam@tiffie.net> Newsgroups: borland.public.cppbuilder.internet.web References: <457aeae7@newsgroups.borland.com> <457afe08@newsgroups.borland.com> <457b1654@newsgroups.borland.com> <457ba45e$1@newsgroups.borland.com> Subject: Re: submit cppwebbrowser Date: Sun, 10 Dec 2006 10:54:54 +0100 Lines: 89 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 84.137.133.144 Message-ID: <457bd937@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1165744439 84.137.133.144 (10 Dec 2006 01:53:59 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!newsfeed.freenet.de!news.albasani.net!feeder06.uucp-net.de!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail