<?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[Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente]]></title><description><![CDATA[<p>Hallo,</p>
<p>auf einem Formular habe ich 40 BitBtn-Objekte. Während der Laufzeit lade ich für all diese ein neues Bitmap in die Eigenschaft Glyph mit folgendem Befehl:</p>
<pre><code>dynamic_cast&lt;TBitBtn*&gt;(Form1-&gt;Components[z2])-&gt;Glyph-&gt;LoadFromFile(&quot;bild.bmp&quot;);
</code></pre>
<p>Kann es sein, dass der LoadFromFile-Befehl, der ja 40mal hintereinander aufgerufen wird, die Ursache für ein Betriebssystemfehler &quot;Die Anweisung in ... verweist auf Speicher in ... Der Vorgang &quot;read&quot; konnte nicht auf dem Speicher durchgeführt werden.&quot; sein kann?</p>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/194171/evtl-problem-beim-laden-neuer-bitmaps-in-eine-bitbtn-komponente</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 03:52:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/194171.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Oct 2007 19:24:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente on Wed, 03 Oct 2007 19:24:20 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>auf einem Formular habe ich 40 BitBtn-Objekte. Während der Laufzeit lade ich für all diese ein neues Bitmap in die Eigenschaft Glyph mit folgendem Befehl:</p>
<pre><code>dynamic_cast&lt;TBitBtn*&gt;(Form1-&gt;Components[z2])-&gt;Glyph-&gt;LoadFromFile(&quot;bild.bmp&quot;);
</code></pre>
<p>Kann es sein, dass der LoadFromFile-Befehl, der ja 40mal hintereinander aufgerufen wird, die Ursache für ein Betriebssystemfehler &quot;Die Anweisung in ... verweist auf Speicher in ... Der Vorgang &quot;read&quot; konnte nicht auf dem Speicher durchgeführt werden.&quot; sein kann?</p>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1377441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377441</guid><dc:creator><![CDATA[williman]]></dc:creator><pubDate>Wed, 03 Oct 2007 19:24:20 GMT</pubDate></item><item><title><![CDATA[Reply to Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente on Wed, 03 Oct 2007 20:15:42 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich glaube eher, daß eines der Components auf Form1 kein TBitBtn ist.<br />
Oder überprüfst Du das vorher ?</p>
<p>Nash</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1377469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377469</guid><dc:creator><![CDATA[Nash]]></dc:creator><pubDate>Wed, 03 Oct 2007 20:15:42 GMT</pubDate></item><item><title><![CDATA[Reply to Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente on Wed, 03 Oct 2007 20:19:49 GMT]]></title><description><![CDATA[<p>Ja, anhand des Komponentennamens.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1377471</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377471</guid><dc:creator><![CDATA[williman]]></dc:creator><pubDate>Wed, 03 Oct 2007 20:19:49 GMT</pubDate></item><item><title><![CDATA[Reply to Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente on Wed, 03 Oct 2007 20:45:35 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Naja, ich glaube das hier ist sicherer :</p>
<pre><code class="language-cpp">if (dynamic_cast&lt;TBitBtn*&gt;(Form2-&gt;Components[z2]) != NULL)
    dynamic_cast&lt;TBitBtn*&gt;(Form2-&gt;Components[z2])-&gt;Glyph-&gt;LoadFromFile(&quot;bild.bmp&quot;);
</code></pre>
<p>Ich hab das gerade mal mit 45 BitBtn versucht und das funktioniert.</p>
<p>Aber mal 'ne andere Frage, wieso benutzt Du LoadFromFile ? Pack doch lieber die benötigten Bilder in eine ImageList und lade die von da.</p>
<p>Nash</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1377479</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377479</guid><dc:creator><![CDATA[Nash]]></dc:creator><pubDate>Wed, 03 Oct 2007 20:45:35 GMT</pubDate></item><item><title><![CDATA[Reply to Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente on Thu, 04 Oct 2007 07:39:13 GMT]]></title><description><![CDATA[<p>Ein cast reicht</p>
<pre><code class="language-cpp">TBitBtn* btn(dynamic_cast&lt;TBitBtn*&gt;(Form2-&gt;Components[z2]));
if ( btn)
   btn-&gt;Glyph-&gt;LoadFromFile(&quot;bild.bmp&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1377586</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377586</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 04 Oct 2007 07:39:13 GMT</pubDate></item><item><title><![CDATA[Reply to Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente on Thu, 04 Oct 2007 12:29:34 GMT]]></title><description><![CDATA[<p>Ist es von Nachteil, wenn man zu oft hintereinander cast benutzt?</p>
<p>Das mit der Imageliste muss ich mir einmal ansehen, Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1377832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377832</guid><dc:creator><![CDATA[williman]]></dc:creator><pubDate>Thu, 04 Oct 2007 12:29:34 GMT</pubDate></item><item><title><![CDATA[Reply to Evtl. Problem beim Laden neuer Bitmaps in eine BitBtn-Komponente on Thu, 04 Oct 2007 12:40:06 GMT]]></title><description><![CDATA[<p>teacherwilli schrieb:</p>
<blockquote>
<p>Ist es von Nachteil, wenn man zu oft hintereinander cast benutzt?</p>
</blockquote>
<p>Ja, es macht den Code unleserlicher. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Es gibt da noch einen kleinen Performancenachteil, der hier aber wohl nicht ins Gewicht fällt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1377844</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377844</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 04 Oct 2007 12:40:06 GMT</pubDate></item></channel></rss>