<?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[Konstruktor]]></title><description><![CDATA[<p>Ich kenn mich im Programmieren noch nicht so aus, kann mir jemand etwas erklären.<br />
Ich habe eine Klasse eine Klasse CStillgrundDetailDlg. Ich verwende eine Variable strDetailBtn.<br />
Ich muss einen Konstruktor verwenden:</p>
<pre><code class="language-cpp">CStillDetailDlg(const CString &amp;strDetailBtn)
</code></pre>
<p>Wo muss ich diesen Konstrukor eintragen in einer neuen Funktion innerhalb des CStillgrundDetailDlg?<br />
Nachher möchte ich dann &amp;strDetailBtn auf MG setzen und zwar so:</p>
<pre><code class="language-cpp">CStillgrundDetailDlg(&quot;MG&quot;)
</code></pre>
<p>Dannach möchte ich einer weiteren Klasse CDetailDlg folgendes Verwenden</p>
<pre><code class="language-cpp">if (strDetailBtn==&quot;MG&quot;)
{
}
</code></pre>
<p>Danke im Voraus für eure Mühe<br />
Yvonne</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/5667/konstruktor</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 04:58:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/5667.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 May 2003 11:01:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Konstruktor on Fri, 02 May 2003 11:01:00 GMT]]></title><description><![CDATA[<p>Ich kenn mich im Programmieren noch nicht so aus, kann mir jemand etwas erklären.<br />
Ich habe eine Klasse eine Klasse CStillgrundDetailDlg. Ich verwende eine Variable strDetailBtn.<br />
Ich muss einen Konstruktor verwenden:</p>
<pre><code class="language-cpp">CStillDetailDlg(const CString &amp;strDetailBtn)
</code></pre>
<p>Wo muss ich diesen Konstrukor eintragen in einer neuen Funktion innerhalb des CStillgrundDetailDlg?<br />
Nachher möchte ich dann &amp;strDetailBtn auf MG setzen und zwar so:</p>
<pre><code class="language-cpp">CStillgrundDetailDlg(&quot;MG&quot;)
</code></pre>
<p>Dannach möchte ich einer weiteren Klasse CDetailDlg folgendes Verwenden</p>
<pre><code class="language-cpp">if (strDetailBtn==&quot;MG&quot;)
{
}
</code></pre>
<p>Danke im Voraus für eure Mühe<br />
Yvonne</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27596</guid><dc:creator><![CDATA[wutzi]]></dc:creator><pubDate>Fri, 02 May 2003 11:01:00 GMT</pubDate></item><item><title><![CDATA[Reply to Konstruktor on Fri, 02 May 2003 13:10:00 GMT]]></title><description><![CDATA[<p>Ich hab das jetzt mal so verstanden:</p>
<pre><code class="language-cpp">class CStillDetailDlg
{
public:
   CStillDetailDlg(CString s);
   ~CStillDetailDlg();

   CString m_strDetailBtn;
};

CStillDetailDlg::CStillDetailDlg(CString s)
{
   strDetailBtn = s;
}
</code></pre>
<p>Beim Anlegen des CStillDetailDlg-Objektes:</p>
<pre><code class="language-cpp">CStillDetailDlg p(&quot;MG&quot;);

if(p.strDetailBtn == &quot;MG&quot;)
{
   //dein Code...
}
</code></pre>
<p>Sag Bescheid, wenn ich was falsch interpretiert habe.</p>
<p>MfG<br />
Happosai</p>
<p>[ Dieser Beitrag wurde am 02.05.2003 um 15:11 Uhr von <strong>Happosai</strong> editiert. ]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27597</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27597</guid><dc:creator><![CDATA[Sanji]]></dc:creator><pubDate>Fri, 02 May 2003 13:10:00 GMT</pubDate></item><item><title><![CDATA[Reply to Konstruktor on Mon, 05 May 2003 05:50:00 GMT]]></title><description><![CDATA[<p>Ich muss das was ich als Konstruktor bezeichnet habe umbedingt verwenden. Wie bzw. Wo baue ich das ein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27598</guid><dc:creator><![CDATA[wutzi]]></dc:creator><pubDate>Mon, 05 May 2003 05:50:00 GMT</pubDate></item><item><title><![CDATA[Reply to Konstruktor on Mon, 05 May 2003 07:07:00 GMT]]></title><description><![CDATA[<p>So soll es irgendwie aussehen:</p>
<pre><code class="language-cpp">class CStillgrundDetailDlg
{
public:
   CString strDetailBtn;
};

void CStillgrundDlg::OnDetailBtnMg()
// Öffnet den DetailDlg
{
    CStillgrundDetailDlg(&quot;MG&quot;);
    OnDetailBtn();  
}

CStillgrundDetailDlg(const CString &amp;strDetailBtn)//Wo gehört diese Zeile hin und was muss ich sonst noch beachten
</code></pre>
<p>______________________________________________________________________________</p>
<p>Aussehen tut es momentan aber so:</p>
<pre><code class="language-cpp">class CStillgrundDetailDlg
{
public:
   CString strDetailBtn;
};

void CStillgrundDlg::OnDetailBtnMg()
{
strDetailBtn=&quot;MG&quot;
}
void CStillgrundDlg::OnDetailBtnMt()
{
strDetailBtn=&quot;MT&quot;
}
void CStillgrundDlg::OnDetailBtnM()
{
strDetailBtn=&quot;M&quot;
}

void CStillgrundDetailDlg::OnDetailBtn()
//Öffnet den DetailDlg
{
    if(strDetailBtn==MG)
{
//Öffne MG-Tabelle aus Datenbank
}
if(strDetailBtn==M)
{
//Öffne M-Tabelle aus Datenbank
}
if(strDetailBtn==MT)
{
//Öffne MT-Tabelle aus Datenbank
}
    OnDetailBtn();  
}
</code></pre>
<p>[ Dieser Beitrag wurde am 05.05.2003 um 09:46 Uhr von <strong>wutzi</strong> editiert. ]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27599</guid><dc:creator><![CDATA[wutzi]]></dc:creator><pubDate>Mon, 05 May 2003 07:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to Konstruktor on Mon, 05 May 2003 09:23:00 GMT]]></title><description><![CDATA[<p>Ich komme meinem Problem schon näher, brauch also gerade keine Hilfe. Also danke an alle die sich in das Problem eingelesen haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27600</guid><dc:creator><![CDATA[wutzi]]></dc:creator><pubDate>Mon, 05 May 2003 09:23:00 GMT</pubDate></item></channel></rss>