<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Verständisproblem Frames im cppWebrowser]]></title><description><![CDATA[<p>Hi</p>
<p>ich versuche gerade folgenden Quellcode von <a href="http://www.bytesandmore.de/rad/cpp/snipp/sc08019.php" rel="nofollow">http://www.bytesandmore.de/rad/cpp/snipp/sc08019.php</a></p>
<p>zu verstehen:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------
// Durchsuchen der RAD-Seiten:
//---------------------------------------------------------------------------
void __fastcall TfrmMain::menuRadPagesSearchClick(TObject *Sender)
{
  // Zur Sicherheit die Seite annavigieren:
  CppWebBrowser-&gt;Navigate(WideString(&quot;http://www.bytesandmore.de/rad/&quot;));
  while(!CppWebBrowser-&gt;Busy) Application-&gt;ProcessMessages();
  while(CppWebBrowser-&gt;Busy) Application-&gt;ProcessMessages();

  if(CppWebBrowser-&gt;LocationURL !=
    WideString(&quot;http://www.bytesandmore.de/rad/&quot;))
  {
    ShowMessage(&quot;Seite http://www.bytesandmore.de/rad/ &quot;
      &quot;konnte nicht geladen werden !&quot;);
    return;
  }

  // Suchstring eingeben lassen:
  AnsiString slSearchString = InputBox(&quot;Suche auf RAD-Pages&quot;,
    &quot;Bitte geben Sie den Suchbegriff ein:&quot;, &quot;TRegistry&quot;);
  if(slSearchString == EmptyStr)
    return;

  IHTMLDocument2 *HTMLDocument = NULL;
  LONG ilFramesCount = 0;

  // Falls eine Seite geladen:
  if(SUCCEEDED(CppWebBrowser-&gt;Document-&gt;QueryInterface(
    IID_IHTMLDocument2, (LPVOID*)&amp;HTMLDocument)))
  {
    // ggf. auch Frames-Code extrahieren:
    IHTMLFramesCollection2 *pFrames = NULL;
    if(SUCCEEDED(HTMLDocument-&gt;get_frames(&amp;pFrames)))
    {
      // Anzahl der Frames bestimmen:
      pFrames-&gt;get_length(&amp;ilFramesCount);

      if(ilFramesCount &lt; 2)
        EnterSearchWordsAndSubmit(HTMLDocument, slSearchString,
          &quot;terms&quot;, &quot;SearchForm&quot;);
      else
      {
        VARIANT vFrame;
        VARIANT ret;
        vFrame.vt = VT_UINT;
        vFrame.lVal = 1;

        if(SUCCEEDED(pFrames-&gt;item(&amp;vFrame, &amp;ret)))
        {
          // Zeiger auf IHTMLWindow2 des Frames besorgen:
          IHTMLWindow2 *pWindow = NULL;
          if(SUCCEEDED(ret.pdispVal-&gt;QueryInterface(IID_IHTMLWindow2,
            (LPVOID*)&amp;pWindow)))
          {
            // Zeiger auf IHTMLDocument2 des Frames besorgen:
            IHTMLDocument2 *pDoc = NULL;
            if(SUCCEEDED(pWindow-&gt;get_document(&amp;pDoc)))
            {
              EnterSearchWordsAndSubmit(pDoc, slSearchString,
                &quot;terms&quot;, &quot;SearchForm&quot;);
              pDoc-&gt;Release();
            }
            pWindow-&gt;Release();
          }
        }
      }
      pFrames-&gt;Release();
    }
    HTMLDocument-&gt;Release();
  }
}

//---------------------------------------------------------------------------
// Funktion EnterSearchWordsAndSubmit() trägt den im Parameter slSearchString
// übergebenen Suchbegriff ins Eingabefeld (input) mit dem Namen slInputName
// des HTML-Formulars slHtmlFormName und startet die Suche.
//
// Im Parameter pHTMLDocument wird der Zeiger auf IHTMLDocument2-Interface
// des zu verwendenden HTMLDocuments übergeben.
//---------------------------------------------------------------------------
void EnterSearchWordsAndSubmit(IHTMLDocument2* pHTMLDocument,
  AnsiString slSearchString, AnsiString slInputName, AnsiString slHtmlFormName)
{
  if(pHTMLDocument != NULL)
  {
    IHTMLElementCollection *pAll = NULL;
    if(SUCCEEDED(pHTMLDocument-&gt;get_all(&amp;pAll)) &amp;&amp; pAll)
    {
      // Name des Eingabefeldes (sieh HTML source der Seite)
      TVariant vName = slInputName;
      TVariant vIndex = 0;
      IDispatch *pDisp = NULL;

      if(SUCCEEDED(pAll-&gt;item(vName, vIndex, &amp;pDisp)) &amp;&amp; pDisp)
      {
        IHTMLInputElement *pInput = NULL;     // mshtml.h
        if(SUCCEEDED(pDisp-&gt;QueryInterface(IID_IHTMLInputElement,
          (LPVOID*)&amp;pInput)) &amp;&amp; pInput)
        {
          // String in das Eingabefeld eintragen:
          pInput-&gt;put_value(WideString(slSearchString));
          pInput-&gt;Release();
        }
        pDisp-&gt;Release();
      }
      pAll-&gt;Release();

      // Formulareingaben abschicken (SUBMIT)
      IHTMLElementCollection *HTMLForms = NULL;
      if(SUCCEEDED(pHTMLDocument-&gt;get_forms(&amp;HTMLForms)) &amp;&amp; HTMLForms)
      {
        // Name des HTML-Formulars &lt;form name=&quot;SearchForm&quot;...&gt;
        vName = slHtmlFormName;
        vIndex = 0;
        if(SUCCEEDED(HTMLForms-&gt;item(vName, vIndex, &amp;pDisp)) &amp;&amp; pDisp)
        {
          IHTMLFormElement *HTMLForm = NULL;
          if(SUCCEEDED(pDisp-&gt;QueryInterface(IID_IHTMLFormElement,
            (LPVOID*)&amp;HTMLForm)) &amp;&amp; HTMLForm)
          {
            HTMLForm-&gt;submit();
            HTMLForm-&gt;Release();
          }
          pDisp-&gt;Release();
        }
        HTMLForms-&gt;Release();
      }
    }
  }
}
</code></pre>
<p>Aber wo wird da der zu bearbeitende Frame ausgewählt?</p>
<p>Hiermit?</p>
<p>[cpp]vFrame.lVal = 1;[cpp]</p>
<p>Hoffe da kann mir jemand weiterhelfen, weil ich denn Code irgendwie nicht verstehe!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/151309/verständisproblem-frames-im-cppwebrowser</link><generator>RSS for Node</generator><lastBuildDate>Sat, 08 Aug 2026 17:12:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/151309.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Jun 2006 01:15:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Verständisproblem Frames im cppWebrowser on Sun, 25 Jun 2006 01:15:50 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>ich versuche gerade folgenden Quellcode von <a href="http://www.bytesandmore.de/rad/cpp/snipp/sc08019.php" rel="nofollow">http://www.bytesandmore.de/rad/cpp/snipp/sc08019.php</a></p>
<p>zu verstehen:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------
// Durchsuchen der RAD-Seiten:
//---------------------------------------------------------------------------
void __fastcall TfrmMain::menuRadPagesSearchClick(TObject *Sender)
{
  // Zur Sicherheit die Seite annavigieren:
  CppWebBrowser-&gt;Navigate(WideString(&quot;http://www.bytesandmore.de/rad/&quot;));
  while(!CppWebBrowser-&gt;Busy) Application-&gt;ProcessMessages();
  while(CppWebBrowser-&gt;Busy) Application-&gt;ProcessMessages();

  if(CppWebBrowser-&gt;LocationURL !=
    WideString(&quot;http://www.bytesandmore.de/rad/&quot;))
  {
    ShowMessage(&quot;Seite http://www.bytesandmore.de/rad/ &quot;
      &quot;konnte nicht geladen werden !&quot;);
    return;
  }

  // Suchstring eingeben lassen:
  AnsiString slSearchString = InputBox(&quot;Suche auf RAD-Pages&quot;,
    &quot;Bitte geben Sie den Suchbegriff ein:&quot;, &quot;TRegistry&quot;);
  if(slSearchString == EmptyStr)
    return;

  IHTMLDocument2 *HTMLDocument = NULL;
  LONG ilFramesCount = 0;

  // Falls eine Seite geladen:
  if(SUCCEEDED(CppWebBrowser-&gt;Document-&gt;QueryInterface(
    IID_IHTMLDocument2, (LPVOID*)&amp;HTMLDocument)))
  {
    // ggf. auch Frames-Code extrahieren:
    IHTMLFramesCollection2 *pFrames = NULL;
    if(SUCCEEDED(HTMLDocument-&gt;get_frames(&amp;pFrames)))
    {
      // Anzahl der Frames bestimmen:
      pFrames-&gt;get_length(&amp;ilFramesCount);

      if(ilFramesCount &lt; 2)
        EnterSearchWordsAndSubmit(HTMLDocument, slSearchString,
          &quot;terms&quot;, &quot;SearchForm&quot;);
      else
      {
        VARIANT vFrame;
        VARIANT ret;
        vFrame.vt = VT_UINT;
        vFrame.lVal = 1;

        if(SUCCEEDED(pFrames-&gt;item(&amp;vFrame, &amp;ret)))
        {
          // Zeiger auf IHTMLWindow2 des Frames besorgen:
          IHTMLWindow2 *pWindow = NULL;
          if(SUCCEEDED(ret.pdispVal-&gt;QueryInterface(IID_IHTMLWindow2,
            (LPVOID*)&amp;pWindow)))
          {
            // Zeiger auf IHTMLDocument2 des Frames besorgen:
            IHTMLDocument2 *pDoc = NULL;
            if(SUCCEEDED(pWindow-&gt;get_document(&amp;pDoc)))
            {
              EnterSearchWordsAndSubmit(pDoc, slSearchString,
                &quot;terms&quot;, &quot;SearchForm&quot;);
              pDoc-&gt;Release();
            }
            pWindow-&gt;Release();
          }
        }
      }
      pFrames-&gt;Release();
    }
    HTMLDocument-&gt;Release();
  }
}

//---------------------------------------------------------------------------
// Funktion EnterSearchWordsAndSubmit() trägt den im Parameter slSearchString
// übergebenen Suchbegriff ins Eingabefeld (input) mit dem Namen slInputName
// des HTML-Formulars slHtmlFormName und startet die Suche.
//
// Im Parameter pHTMLDocument wird der Zeiger auf IHTMLDocument2-Interface
// des zu verwendenden HTMLDocuments übergeben.
//---------------------------------------------------------------------------
void EnterSearchWordsAndSubmit(IHTMLDocument2* pHTMLDocument,
  AnsiString slSearchString, AnsiString slInputName, AnsiString slHtmlFormName)
{
  if(pHTMLDocument != NULL)
  {
    IHTMLElementCollection *pAll = NULL;
    if(SUCCEEDED(pHTMLDocument-&gt;get_all(&amp;pAll)) &amp;&amp; pAll)
    {
      // Name des Eingabefeldes (sieh HTML source der Seite)
      TVariant vName = slInputName;
      TVariant vIndex = 0;
      IDispatch *pDisp = NULL;

      if(SUCCEEDED(pAll-&gt;item(vName, vIndex, &amp;pDisp)) &amp;&amp; pDisp)
      {
        IHTMLInputElement *pInput = NULL;     // mshtml.h
        if(SUCCEEDED(pDisp-&gt;QueryInterface(IID_IHTMLInputElement,
          (LPVOID*)&amp;pInput)) &amp;&amp; pInput)
        {
          // String in das Eingabefeld eintragen:
          pInput-&gt;put_value(WideString(slSearchString));
          pInput-&gt;Release();
        }
        pDisp-&gt;Release();
      }
      pAll-&gt;Release();

      // Formulareingaben abschicken (SUBMIT)
      IHTMLElementCollection *HTMLForms = NULL;
      if(SUCCEEDED(pHTMLDocument-&gt;get_forms(&amp;HTMLForms)) &amp;&amp; HTMLForms)
      {
        // Name des HTML-Formulars &lt;form name=&quot;SearchForm&quot;...&gt;
        vName = slHtmlFormName;
        vIndex = 0;
        if(SUCCEEDED(HTMLForms-&gt;item(vName, vIndex, &amp;pDisp)) &amp;&amp; pDisp)
        {
          IHTMLFormElement *HTMLForm = NULL;
          if(SUCCEEDED(pDisp-&gt;QueryInterface(IID_IHTMLFormElement,
            (LPVOID*)&amp;HTMLForm)) &amp;&amp; HTMLForm)
          {
            HTMLForm-&gt;submit();
            HTMLForm-&gt;Release();
          }
          pDisp-&gt;Release();
        }
        HTMLForms-&gt;Release();
      }
    }
  }
}
</code></pre>
<p>Aber wo wird da der zu bearbeitende Frame ausgewählt?</p>
<p>Hiermit?</p>
<p>[cpp]vFrame.lVal = 1;[cpp]</p>
<p>Hoffe da kann mir jemand weiterhelfen, weil ich denn Code irgendwie nicht verstehe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084857</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084857</guid><dc:creator><![CDATA[dagsta]]></dc:creator><pubDate>Sun, 25 Jun 2006 01:15:50 GMT</pubDate></item><item><title><![CDATA[Reply to Verständisproblem Frames im cppWebrowser on Sun, 25 Jun 2006 02:00:14 GMT]]></title><description><![CDATA[<p>dagsta schrieb:</p>
<blockquote>
<p>Hiermit?</p>
<pre><code class="language-cpp">vFrame.lVal = 1;
</code></pre>
</blockquote>
<p>Genau. 0 entspricht dem ersten Frame, 1 dem zweiten usw.</p>
<p>Aber hätte das nicht als Nachfrage in deinen <a href="http://c-plusplus.net/forum/viewtopic-var-t-is-151140.html" rel="nofollow">anderen Thread</a> zum Thema gepasst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084859</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 25 Jun 2006 02:00:14 GMT</pubDate></item><item><title><![CDATA[Reply to Verständisproblem Frames im cppWebrowser on Sun, 25 Jun 2006 17:25:26 GMT]]></title><description><![CDATA[<p>Gibt es den irgentwo eine Dokumentation über diese Funktionen? In der BCB Hilfe findet sich garnichts darüber!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1085288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1085288</guid><dc:creator><![CDATA[Dagsta_t]]></dc:creator><pubDate>Sun, 25 Jun 2006 17:25:26 GMT</pubDate></item></channel></rss>