<?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[SelectedRows]]></title><description><![CDATA[<p>hallo,</p>
<p>ich habe mich mit SelectedRows befasst schaffe es aber nicht die ausgewälten Zeilen meines DBGrids zu Identifizieren, das Beispiel das es in der Hilfe gibt half mir auch nicht weiter da es bei mir nicht funktioniert.</p>
<pre><code class="language-cpp">if (DBGrid1-&gt;SelectedRows-&gt;Count &gt; 0)
  {
    AnsiString s = &quot;&quot;;
    TDataSet *pDS = DBGrid1-&gt;DataSource-&gt;DataSet;
    for (int i=0; i &lt; DBGrid1-&gt;SelectedRows-&gt;Count; i++)
    {
      pDS-&gt;GotoBookmark((void* )DBGrid1-&gt;SelectedRows-&gt;Items[i]);
      for (int j = 0; j &lt; pDS-&gt;FieldCount; j++)
      {
        if (j&gt;0)
          s = s+&quot;, &quot;;
        s = s + pDS-&gt;Fields-&gt;Fields[j]-&gt;AsString;

      }
      ListBox1-&gt;Items-&gt;Add(s);
      s = &quot;&quot;;
    }
  }
</code></pre>
<p>der fehler lautet:<br />
[C++ Fehler] verkehrsmittel_formular.cpp(157): E2031 Typumwandlung von 'AnsiString' nach 'void *' nicht zulässig.</p>
<p>kann mir jemand helfen?</p>
<p>edit: so besser?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147279/selectedrows</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 02:03:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147279.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 May 2006 14:54:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SelectedRows on Mon, 15 May 2006 15:08:10 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>ich habe mich mit SelectedRows befasst schaffe es aber nicht die ausgewälten Zeilen meines DBGrids zu Identifizieren, das Beispiel das es in der Hilfe gibt half mir auch nicht weiter da es bei mir nicht funktioniert.</p>
<pre><code class="language-cpp">if (DBGrid1-&gt;SelectedRows-&gt;Count &gt; 0)
  {
    AnsiString s = &quot;&quot;;
    TDataSet *pDS = DBGrid1-&gt;DataSource-&gt;DataSet;
    for (int i=0; i &lt; DBGrid1-&gt;SelectedRows-&gt;Count; i++)
    {
      pDS-&gt;GotoBookmark((void* )DBGrid1-&gt;SelectedRows-&gt;Items[i]);
      for (int j = 0; j &lt; pDS-&gt;FieldCount; j++)
      {
        if (j&gt;0)
          s = s+&quot;, &quot;;
        s = s + pDS-&gt;Fields-&gt;Fields[j]-&gt;AsString;

      }
      ListBox1-&gt;Items-&gt;Add(s);
      s = &quot;&quot;;
    }
  }
</code></pre>
<p>der fehler lautet:<br />
[C++ Fehler] verkehrsmittel_formular.cpp(157): E2031 Typumwandlung von 'AnsiString' nach 'void *' nicht zulässig.</p>
<p>kann mir jemand helfen?</p>
<p>edit: so besser?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058242</guid><dc:creator><![CDATA[webmaster1987]]></dc:creator><pubDate>Mon, 15 May 2006 15:08:10 GMT</pubDate></item><item><title><![CDATA[Reply to SelectedRows on Mon, 15 May 2006 14:57:58 GMT]]></title><description><![CDATA[<p>es ist jedesmal höchst intressant zu hören ,dass ES nicht funktioniert.</p>
<p>ich empfehle dir mal diese Lektüre: <a href="http://www.lugbz.org/documents/smart-questions_de.html" rel="nofollow">http://www.lugbz.org/documents/smart-questions_de.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058246</guid><dc:creator><![CDATA[BigNeal]]></dc:creator><pubDate>Mon, 15 May 2006 14:57:58 GMT</pubDate></item><item><title><![CDATA[Reply to SelectedRows on Mon, 15 May 2006 18:19:40 GMT]]></title><description><![CDATA[<p>Hat sich niemand mit dem mehrfachen selektieren von DBGrid Zeilen befasst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058394</guid><dc:creator><![CDATA[webmaster1987]]></dc:creator><pubDate>Mon, 15 May 2006 18:19:40 GMT</pubDate></item><item><title><![CDATA[Reply to SelectedRows on Mon, 15 May 2006 18:28:41 GMT]]></title><description><![CDATA[<p>1. wenn du editierst, sieht man nicht, dass neue infos stehen.. besser neues posting machen<br />
2. wenn du so eine Fehlermeldung angiebst, gib auch an, wo der Compiler hinspringt. wir können shclecht erraten, welche Zeile die nr. 157 ist.</p>
<p>zum Problem:<br />
mit den vorhandenen Infos gehe ich mal davon aus, dass der Fehler in dieser Zeile auftritt:</p>
<pre><code class="language-cpp">pDS-&gt;GotoBookmark((void* )DBGrid1-&gt;SelectedRows-&gt;Items);
</code></pre>
<ul>
<li></li>
</ul>
<p>das Problem ist, dass AnsiString kein Zeiger ist.<br />
um einen Zeiger auf den string zu bekommen, gibts die Funktion [i]AnsiString::c_str()*</p>
<p>wenn ich richtig liebe funktionierts mit:</p>
<pre><code class="language-cpp">pDS-&gt;GotoBookmark((void* )DBGrid1-&gt;SelectedRows-&gt;Items[i].c_str());
</code></pre>
<p>edit: aber das würde ja auch richtig im Beispiel von der BCB-Hilfe stehen, das du kopiert/abgeschrieben hast(vermute ich jetzt mal).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058402</guid><dc:creator><![CDATA[BigNeal]]></dc:creator><pubDate>Mon, 15 May 2006 18:28:41 GMT</pubDate></item><item><title><![CDATA[Reply to SelectedRows on Mon, 15 May 2006 18:43:12 GMT]]></title><description><![CDATA[<p>also danke für den c_str() das hat geholfen aber in meiner hilfe (Borland 4) steht das ohne das c_str().</p>
<p>danke nochmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058415</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058415</guid><dc:creator><![CDATA[webmaster1987]]></dc:creator><pubDate>Mon, 15 May 2006 18:43:12 GMT</pubDate></item><item><title><![CDATA[Reply to SelectedRows on Mon, 15 May 2006 18:46:57 GMT]]></title><description><![CDATA[<p>webmaster1987 schrieb:</p>
<blockquote>
<p>also danke für den c_str() das hat geholfen aber in meiner hilfe (Borland 4) steht das ohne das c_str().</p>
</blockquote>
<p>schon? dan ist es wohl noch ein Fehler.. Bei mir mit BCB6 ist es mit c_str()</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058417</guid><dc:creator><![CDATA[BigNeal]]></dc:creator><pubDate>Mon, 15 May 2006 18:46:57 GMT</pubDate></item><item><title><![CDATA[Reply to SelectedRows on Mon, 15 May 2006 19:26:21 GMT]]></title><description><![CDATA[<p>sieht so aus als hätten wir gerade einen fehler in der BCB4 Hilfe gefunden <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058438</guid><dc:creator><![CDATA[webmaster1987]]></dc:creator><pubDate>Mon, 15 May 2006 19:26:21 GMT</pubDate></item></channel></rss>