<?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[Form1 + Form2 Problem :(]]></title><description><![CDATA[<p>Hi.</p>
<p>Ich habe 2 Formulare und jetzt ein grosses Problem.</p>
<p>Beim Start von Form1 möchte ich in Form2-&gt;Memo1 Text ausgeben. Sone Art Logdatei.</p>
<p>Leider kassiere ich für diesen Versuch nur Speicher bzw Zugriffsfehler.</p>
<p>Ich habe dann Form2-&gt;Memo1-&gt;Lines-&gt;Add(&quot;logzeile&quot;); von TForm1::TForm1 nach TForm1::OnShow verschoben. Das half aber leider auch nichts.</p>
<p>Was mach ich denn falsch? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146464/form1-form2-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 21:12:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146464.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 May 2006 07:46:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 07:46:31 GMT]]></title><description><![CDATA[<p>Hi.</p>
<p>Ich habe 2 Formulare und jetzt ein grosses Problem.</p>
<p>Beim Start von Form1 möchte ich in Form2-&gt;Memo1 Text ausgeben. Sone Art Logdatei.</p>
<p>Leider kassiere ich für diesen Versuch nur Speicher bzw Zugriffsfehler.</p>
<p>Ich habe dann Form2-&gt;Memo1-&gt;Lines-&gt;Add(&quot;logzeile&quot;); von TForm1::TForm1 nach TForm1::OnShow verschoben. Das half aber leider auch nichts.</p>
<p>Was mach ich denn falsch? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053147</guid><dc:creator><![CDATA[Maiky]]></dc:creator><pubDate>Mon, 08 May 2006 07:46:31 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 07:49:27 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>siehe FAQ, Abschnitt Forms, Thema <em>Variablenübergabe an andere Form</em>.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053151</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053151</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 08 May 2006 07:49:27 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:01:00 GMT]]></title><description><![CDATA[<p>Tut mir leid, aber das verstehe ich jetzt leider nicht. Was soll mir das helfen? Wie man auf Variablen zugreift weiss ich doch. Wenn ich das Form2-&gt;Memo1 über Button machen würde, würde es ja auch gehen... nur scheinbar nicht beim direkten Start. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053161</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053161</guid><dc:creator><![CDATA[Maiky]]></dc:creator><pubDate>Mon, 08 May 2006 08:01:00 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:02:34 GMT]]></title><description><![CDATA[<p>existiert Form2 zum Zeitpunkt des Zugriffs überhaupt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053164</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Mon, 08 May 2006 08:02:34 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:09:52 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ja die Forms werden ja auch der Reihe nach estellt.<br />
Als erstes wird dein Mainform erzeugt.<br />
Wenn du dann im Konstruktor schon auf eines der anderen Forms zugreifst, kommt natürlich eine Zugriffsverletzung, andere Forms sind noch nicht erzeugt wurden.<br />
Du solltest also dein Konzept verändern. Ich empfehle die Log-Aufrufe unabhängig von einem Form zu machen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053172</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053172</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 08 May 2006 08:09:52 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:10:45 GMT]]></title><description><![CDATA[<p>Form2 ist keine zur Laufzeit erstellte Komponente. Deine Frage würde schlussfolgernd bedeuten, man kann dies festlegen. Dann würde sich mir die Frage aufzwängen: &quot;wie?&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053174</guid><dc:creator><![CDATA[Maiky]]></dc:creator><pubDate>Mon, 08 May 2006 08:10:45 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:19:08 GMT]]></title><description><![CDATA[<p>Linnea schrieb:</p>
<blockquote>
<p>existiert Form2 zum Zeitpunkt des Zugriffs überhaupt?</p>
</blockquote>
<p>Nein.<br />
In der OnShow sollte es allerdings funktionieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053180</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053180</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 08 May 2006 08:19:08 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:19:32 GMT]]></title><description><![CDATA[<p>akari schrieb:</p>
<blockquote>
<p>Wenn du dann im Konstruktor schon auf eines der anderen Forms zugreifst, kommt natürlich eine Zugriffsverletzung, andere Forms sind noch nicht erzeugt wurden.</p>
</blockquote>
<p>Das ist erlich gesagt doof und ein Designfehler in CBuilder?, wenn das wirklich nicht gehen sollte. Diverse Programme haben beim Start sofort 2 Forms wo etwas passiert, das hier irritiert mich jetzt ein wenig.</p>
<p>Ich würde jetzt nur die Möglichkeit sehen zu &quot;tricksen&quot; und einen Timer reinzusetzen der nach ~2s erst wirklich das startet was ich starten möchte.<br />
In der Hoffnung das bis dahin Borland endlich alle Formulare erstellt hat.</p>
<p>Oder im TForm2::TForm2 eine Variable aus TForm1 auswerten und mit der Abarbeitung beginnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053181</guid><dc:creator><![CDATA[Maiky]]></dc:creator><pubDate>Mon, 08 May 2006 08:19:32 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:22:06 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>theoretisch kannst du in der Projektcode-Datei die Reihenfolge schon ändern.<br />
Aber die Reihenfolge gibt aber auch an, welches Form dein Mainform ist.<br />
Und zwar immer das erste, welches auch immer zuerst erstellt wird.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053186</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053186</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 08 May 2006 08:22:06 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 08:24:00 GMT]]></title><description><![CDATA[<p>Das ist kein Designfehler. Zuerst werden die Konstruktoren abgearbeitet.</p>
<p>Du kannst die Formulare ja auch manuell erstellen. Nimm das zweite Form aus der Liste der automatisch zu erzeugenden Forms und erstelle selbst eine Instanz.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053187</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 08 May 2006 08:24:00 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 10:46:58 GMT]]></title><description><![CDATA[<p>Das ist jetzt wohl etwas ausserhalb meines Wissens. Könntest du, falls nicht zuviel Aufwand, bitte mit Code zeigen?</p>
<p>Im übrigen habe ich es über die TForm2::TForm2 Variante gelöst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053262</guid><dc:creator><![CDATA[Maiky]]></dc:creator><pubDate>Mon, 08 May 2006 10:46:58 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 11:27:13 GMT]]></title><description><![CDATA[<p>Maiky schrieb:</p>
<blockquote>
<p>Das ist jetzt wohl etwas ausserhalb meines Wissens. Könntest du, falls nicht zuviel Aufwand, bitte mit Code zeigen?</p>
</blockquote>
<p>Ich denke der Code alleine würde Dir nichts nützen, so lange Du nicht weiß, was da, warum passieren muß.</p>
<p>Ich kann Deine Kenntnisse nicht einschätzen, aber ein Formular läßt sich, wie jedes andere Objekt auch, mit new erzeugen. Solltest Du das nicht verstehen, oder umsetzen können, solltest Du Dir vielleicht die Grundlagen etwas intensiver aneignen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053292</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 08 May 2006 11:27:13 GMT</pubDate></item><item><title><![CDATA[Reply to Form1 + Form2 Problem :( on Mon, 08 May 2006 11:42:38 GMT]]></title><description><![CDATA[<p>Wie man eine Instanz erstellt ist mir klar, nur wo soll ich diese erstellen? in TForm1::OnCreate ?</p>
<p>Ich habe an diesem Rechner leider keine Entwicklung, aber die Zeile die ich dafür rausnehmen soll steht in Project1.cpp? nehme ich mal an wo die Formulare initialisiert werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053309</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053309</guid><dc:creator><![CDATA[Maiky]]></dc:creator><pubDate>Mon, 08 May 2006 11:42:38 GMT</pubDate></item></channel></rss>