<?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[TLabel *SomeLabels[] ??? Geht das so?]]></title><description><![CDATA[<p>Ich möchte gern eine dynamischen Array von TLabels.</p>
<pre><code class="language-cpp">class myClass{
  private:
    TStringList *Methods;
    TLabel *MethodLabels[];
  public:
    void Update(void);
  //...

void myClass::Update(void)
{
  for(int s = 0;s &lt; Methods-&gt;Count;++s){
    if(MethodLabels[s])
      delete(MethodLabels);
    *MethodLabels = NULL;

    MethodLabels[s] = new TLabel(Owner);
    //...
  }
}
</code></pre>
<p>Ich füge dann beim Click auf einen Button immer einen neuen String der StringList zu und rufe einmal Update() auf. Demnach kriege ich immer ein Label mehr. Aber beim achten Klick stürzt das programm mit einer Meldung Access violation at address 00000000 ab.<br />
Woran kann das liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/89312/tlabel-somelabels-geht-das-so</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 03:51:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/89312.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Oct 2004 15:39:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TLabel *SomeLabels[] ??? Geht das so? on Mon, 18 Oct 2004 15:39:11 GMT]]></title><description><![CDATA[<p>Ich möchte gern eine dynamischen Array von TLabels.</p>
<pre><code class="language-cpp">class myClass{
  private:
    TStringList *Methods;
    TLabel *MethodLabels[];
  public:
    void Update(void);
  //...

void myClass::Update(void)
{
  for(int s = 0;s &lt; Methods-&gt;Count;++s){
    if(MethodLabels[s])
      delete(MethodLabels);
    *MethodLabels = NULL;

    MethodLabels[s] = new TLabel(Owner);
    //...
  }
}
</code></pre>
<p>Ich füge dann beim Click auf einen Button immer einen neuen String der StringList zu und rufe einmal Update() auf. Demnach kriege ich immer ein Label mehr. Aber beim achten Klick stürzt das programm mit einer Meldung Access violation at address 00000000 ab.<br />
Woran kann das liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/631737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/631737</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Mon, 18 Oct 2004 15:39:11 GMT</pubDate></item><item><title><![CDATA[Reply to TLabel *SomeLabels[] ??? Geht das so? on Mon, 18 Oct 2004 18:51:40 GMT]]></title><description><![CDATA[<p>Als erstes sieh mal in der FAQ, da steht was zu dynamischem Erzeugen von Komponenten.</p>
<p>Als zweites: Sieh dir das Template vetor aus der STL mal genauer an. Damit lässt sich IMO leichter ein dynamisches Array, so wie du es willst, verwalten. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/631923</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/631923</guid><dc:creator><![CDATA[PuppetMaster2k]]></dc:creator><pubDate>Mon, 18 Oct 2004 18:51:40 GMT</pubDate></item><item><title><![CDATA[Reply to TLabel *SomeLabels[] ??? Geht das so? on Tue, 19 Oct 2004 05:47:15 GMT]]></title><description><![CDATA[<p>Wirf auch mal einen Blick auf <strong>TObjectList</strong></p>
]]></description><link>https://www.c-plusplus.net/forum/post/632117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/632117</guid><dc:creator><![CDATA[Peter]]></dc:creator><pubDate>Tue, 19 Oct 2004 05:47:15 GMT</pubDate></item></channel></rss>