<?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[TImageList-&amp;gt;Add =&amp;gt; Access violation ?]]></title><description><![CDATA[<p>Ich versuche zu einer ImageList ein Bitmap hinzuzufügen.</p>
<pre><code class="language-cpp">IL-&gt;Add(bmp2, NULL);
</code></pre>
<p>Wenn ich das nun im Konstruktor des Formulares mache klappt das auch wunderbar.</p>
<p>Wenn ich den selben Code aber beispielsweise beim OnClick eines Buttons ausführen will, erhalte ich das Signal SIGSEGV (11) und eine Access Violation.</p>
<p>Bei beidem wird vorher bmp2 aus einer Datei geladen und auf 16x16 px resized. Ich kann mir nicht erklären, wo der Fehler sein sollte...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/99472/timagelist-gt-add-gt-access-violation</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 14:44:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/99472.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Jan 2005 16:49:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TImageList-&amp;gt;Add =&amp;gt; Access violation ? on Fri, 28 Jan 2005 16:49:04 GMT]]></title><description><![CDATA[<p>Ich versuche zu einer ImageList ein Bitmap hinzuzufügen.</p>
<pre><code class="language-cpp">IL-&gt;Add(bmp2, NULL);
</code></pre>
<p>Wenn ich das nun im Konstruktor des Formulares mache klappt das auch wunderbar.</p>
<p>Wenn ich den selben Code aber beispielsweise beim OnClick eines Buttons ausführen will, erhalte ich das Signal SIGSEGV (11) und eine Access Violation.</p>
<p>Bei beidem wird vorher bmp2 aus einer Datei geladen und auf 16x16 px resized. Ich kann mir nicht erklären, wo der Fehler sein sollte...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709020</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709020</guid><dc:creator><![CDATA[Konsti]]></dc:creator><pubDate>Fri, 28 Jan 2005 16:49:04 GMT</pubDate></item><item><title><![CDATA[Reply to TImageList-&amp;gt;Add =&amp;gt; Access violation ? on Fri, 28 Jan 2005 17:04:40 GMT]]></title><description><![CDATA[<p>Die logische Vermutung wäre, dass die ImageList-Instanz [noch] nicht [mehr] existiert.<br />
Zeig doch mal den kompletten Code eines Minimalprojektes, in dem sich das Problem nachvollziehen lässt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709040</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Fri, 28 Jan 2005 17:04:40 GMT</pubDate></item><item><title><![CDATA[Reply to TImageList-&amp;gt;Add =&amp;gt; Access violation ? on Fri, 28 Jan 2005 17:35:29 GMT]]></title><description><![CDATA[<p>ja das hab ich mir auch gedacht, aber das wird auch zwischendrin nirgendwo deleted oder so...</p>
<pre><code class="language-cpp">__fastcall TMainFrm::TMainFrm(TComponent* Owner)
        : TForm(Owner)
{
TRect ARect;
   bmp-&gt;Width   = 128;
   bmp-&gt;Height  = 128;
   ARect = Rect(0, 0, 16, 16);
   bmp2-&gt;Width  = 16;
   bmp2-&gt;Height = 16;
   bmp-&gt;LoadFromFile(ExtractFileDir(Application-&gt;ExeName)+&quot;/mime-icons/folder.png&quot;);
   bmp2-&gt;Canvas-&gt;StretchDraw(ARect, bmp);
   IL-&gt;Add(bmp2, NULL);
   bmp-&gt;LoadFromFile(ExtractFileDir(Application-&gt;ExeName)+&quot;/mime-icons/folder_open.png&quot;);
   bmp2-&gt;Canvas-&gt;StretchDraw(ARect, bmp);
   IL-&gt;Add(bmp2, NULL);
}
//---------------------------------------------------------------------------
void __fastcall TMainFrm::Button1Click(TObject *Sender)
{
int Index;
TRect ARect;
   bmp-&gt;LoadFromFile(ExtractFileDir(Application-&gt;ExeName)+&quot;/mime-icons/image_bmp.png&quot;);
   ARect = Rect(0, 0, 16, 16);
   bmp2-&gt;Canvas-&gt;StretchDraw(ARect, bmp);
   Index = IL-&gt;Add(bmp2, NULL);
</code></pre>
<p>am image_bmp.png kanns auch nich liegen, hab das schon beliebig vertauscht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709060</guid><dc:creator><![CDATA[Konsti]]></dc:creator><pubDate>Fri, 28 Jan 2005 17:35:29 GMT</pubDate></item><item><title><![CDATA[Reply to TImageList-&amp;gt;Add =&amp;gt; Access violation ? on Fri, 28 Jan 2005 18:05:19 GMT]]></title><description><![CDATA[<p>Habe das jetzt sowohl unter Windows/VCL als auch unter Linux/CLX getestet und kann das Problem nicht nachvollziehen.<br />
Stammt dein Code wirklich aus einem Minimalprojekt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709083</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709083</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Fri, 28 Jan 2005 18:05:19 GMT</pubDate></item></channel></rss>