🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: submit cppwebbrowser

#354
From: Michael Harris
Date: Sat, 09 Dec 2006 18:19
107 lines
4394 bytes
Amidala

    Remy posted the follwing some time ago

void __fastcall TMain::SubmitForm(void)
    {
        TComInterface<IHTMLDocument2> Doc;
        Browser->Document->QueryInterface(IID_IHTMLDocument2,
(LPVOID*)&Doc);
        if( Doc )
        {
            TComInterface<IHTMLElementCollection> Forms;
            Doc->get_forms(&Forms);
            if( Forms )
            {
                long count = 0;
                Forms->get_length(&count);

                for(long x = 0; x < count; ++x)
                {
                    TVariant item = x;
                    TVariant index = 0;
                    TComInterface<IDispatch> Disp;

                    Forms->item(item, index, &Disp);
                    if( Disp )
                    {
                        TComInterface<IHTMLFormElement> Form;
                        Disp->QueryInterface(IID_IHTMLFormElement,
                                                 (LPVOID*)&Form);
                        if( Form )
                        {
                            ShowMessage("Form Found");
                            Form->submit();
                            break;
                        }
                    }
                }
            }
        }
void __fastcall TMain::SubmitForm(void)
    {
        TComInterface<IHTMLDocument2> Doc;
        Browser->Document->QueryInterface(IID_IHTMLDocument2,
                                                               (LPVOID*)&Doc);
        if( Doc )
        {
            TComInterface<IHTMLElementCollection> Forms;
            Doc->get_forms(&Forms);
            if( Forms )
            {
                long count = 0;
                Forms->get_length(&count);

                for(long x = 0; x < count; ++x)
                {
                    TVariant item = x;
                    TVariant index = 0;
                    TComInterface<IDispatch> Disp;

                    Forms->item(item, index, &Disp);
                    if( Disp )
                    {
                        TComInterface<IHTMLFormElement> Form;
                        Disp->QueryInterface(IID_IHTMLFormElement,
                                      (LPVOID*)&Form);
                        if( Form )
                        {
                            ShowMessage("Form Found");
                            Form->submit();
                            break;
                        }
                    }
                }
            }
        }
.
--
Michael

"Amidala" <no-spam@tiffie.net> wrote in message 
news:457aeae7@newsgroups.borland.com...
> hi,
>
> i am looking for a possibility to submit a form in cppwebbrowser. in the 
> newsgroups i found some delphi code i tried to convert to c++:
>
> CppWebBrowser1->OleObject->Document->All->Item("Form1")->Submit;
>
> CppWebBrowser1->OleObject->Document->all->item(OleVariant("Form1"))->Submit();
>
> CppWebBrowser1->OleObject->Document->Forms->Item(0)->Submit();
>
> None of these exmaples works. I always get these errors:
>
> [C++ Fehler] Unit1.cpp(123): E2288 Zeiger auf Struktur auf linker Seite 
> von -> oder von ->* erforderlich
>
> Means
>
> [C++ Fehler] Unit1.cpp(123): E2288 Pointer to structure on the left site 
> of -> or of ->* needed
>
> I have no idea how to solve this problem. can anybody help me?
>
> Amidala
> 
Technical Details
Message-ID: <457afe08@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <457aeae7@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
Reply-To: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
From: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <457aeae7@newsgroups.borland.com>
Subject: Re: submit cppwebbrowser
Date: Sat, 9 Dec 2006 12:19:48 -0600
Lines: 109
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 76.187.71.134
Message-ID: <457afe08@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1165688328 76.187.71.134 (9 Dec 2006 10:18:48 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail