<?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[Übergabe eines CStrings an ein 2. Dialogfeld]]></title><description><![CDATA[<p>Ich habe mit der Klasse CDirTreeCtrl (Falls die jemand kennt...) eine Exploreransicht erstellt in der der Pfad des aktivierten Objekts ermittelt wird und an ein anderes Dialogfeld übergeben.<br />
Das 2. Dialogfeld erhält allerdings einen völlig schwachsinnigen CString à la &quot; §/%)P&amp;§)%)(§$%?&amp;&quot;§=&quot;§/%R/HCID G/I! &quot; und mit dem kann man dann nicht wirklich arbeiten...<br />
Hier der Code der Übergabe, vielleicht könnt ihr mir helfen:</p>
<pre><code class="language-cpp">HTREEITEM hItem=m_dir.GetSelectedItem();
	CInfoMovie dlg;

        if (hItem){
            if(find(m_dir.GetFullPath(hItem)))
		{
			//Code zur Variableneinlesung später hier hin
		}
		else
		{
			if(MessageBox(&quot;No Info for this Item detected. Create a new one?&quot;,&quot;Create an Info&quot;,MB_YESNO))
			{
				MessageBox(m_dir.GetFullPath(hItem),&quot;Path:&quot;);
				dlg.m_strPath=m_dir.GetFullPath(hItem);
				dlg.DoModal();
			}
		}
	}

    else
        MessageBox (&quot;No Item Selected...&quot;);
      }
</code></pre>
<p>wenn ich dann daraufhin im Dialogfeld dlg m_strPath in einer MessageBox ausgeben bzw. es so wie ich es verwednden will in eine Datei reinschreibe kommt der eben genannte Schwachsinn heraus... <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/topic/55352/übergabe-eines-cstrings-an-ein-2-dialogfeld</link><generator>RSS for Node</generator><lastBuildDate>Tue, 02 Jun 2026 00:23:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/55352.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Nov 2003 22:47:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Übergabe eines CStrings an ein 2. Dialogfeld on Sat, 15 Nov 2003 22:47:31 GMT]]></title><description><![CDATA[<p>Ich habe mit der Klasse CDirTreeCtrl (Falls die jemand kennt...) eine Exploreransicht erstellt in der der Pfad des aktivierten Objekts ermittelt wird und an ein anderes Dialogfeld übergeben.<br />
Das 2. Dialogfeld erhält allerdings einen völlig schwachsinnigen CString à la &quot; §/%)P&amp;§)%)(§$%?&amp;&quot;§=&quot;§/%R/HCID G/I! &quot; und mit dem kann man dann nicht wirklich arbeiten...<br />
Hier der Code der Übergabe, vielleicht könnt ihr mir helfen:</p>
<pre><code class="language-cpp">HTREEITEM hItem=m_dir.GetSelectedItem();
	CInfoMovie dlg;

        if (hItem){
            if(find(m_dir.GetFullPath(hItem)))
		{
			//Code zur Variableneinlesung später hier hin
		}
		else
		{
			if(MessageBox(&quot;No Info for this Item detected. Create a new one?&quot;,&quot;Create an Info&quot;,MB_YESNO))
			{
				MessageBox(m_dir.GetFullPath(hItem),&quot;Path:&quot;);
				dlg.m_strPath=m_dir.GetFullPath(hItem);
				dlg.DoModal();
			}
		}
	}

    else
        MessageBox (&quot;No Item Selected...&quot;);
      }
</code></pre>
<p>wenn ich dann daraufhin im Dialogfeld dlg m_strPath in einer MessageBox ausgeben bzw. es so wie ich es verwednden will in eine Datei reinschreibe kommt der eben genannte Schwachsinn heraus... <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/394943</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/394943</guid><dc:creator><![CDATA[Herr der Dinge]]></dc:creator><pubDate>Sat, 15 Nov 2003 22:47:31 GMT</pubDate></item><item><title><![CDATA[Reply to Übergabe eines CStrings an ein 2. Dialogfeld on Sun, 16 Nov 2003 00:42:59 GMT]]></title><description><![CDATA[<p>Speicher das mal in eine temporäre Variable und check mal ob die ok ist.</p>
<p>CString temp (m_dir.GetFullPath(hItem));</p>
]]></description><link>https://www.c-plusplus.net/forum/post/394989</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/394989</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Sun, 16 Nov 2003 00:42:59 GMT</pubDate></item><item><title><![CDATA[Reply to Übergabe eines CStrings an ein 2. Dialogfeld on Sun, 16 Nov 2003 07:15:26 GMT]]></title><description><![CDATA[<p>Hast du schon den Debugger verwendet.<br />
Da sieht man ganz genau wo es habert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/395010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/395010</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Sun, 16 Nov 2003 07:15:26 GMT</pubDate></item><item><title><![CDATA[Reply to Übergabe eines CStrings an ein 2. Dialogfeld on Sun, 16 Nov 2003 11:25:07 GMT]]></title><description><![CDATA[<p>Lol ich hab rausgefunden wo das Problem is weiß aber immernoch nicht weiter: Ich hab mich etwas im Kontext geirrt, m_strPath is ein const char * und m_dir.GetFullPath(hItem); gibt einen CString zurück.<br />
Ich glaub ich bau das ganze erstmal um bevor ich noch was poste <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>
<p>Öhm ja und Debugger...Mehr als tonnenweise adressen kann ich da nicht rauslesen <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>
<p>Später:<br />
Hmm ok ich muss zugeben ich bin beträchtlich verwirrt, da ich keine Ahnung hab mit welchem cast man CString zu const char* umwandelt. Entweder er bringt mir einen Fehler das das nicht möglich ist, oder die Ausgabe bleibt dieselbe...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/395074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/395074</guid><dc:creator><![CDATA[Herr der Dinge]]></dc:creator><pubDate>Sun, 16 Nov 2003 11:25:07 GMT</pubDate></item><item><title><![CDATA[Reply to Übergabe eines CStrings an ein 2. Dialogfeld on Sun, 16 Nov 2003 12:12:22 GMT]]></title><description><![CDATA[<blockquote>
<p>m_strPath is ein const char * und m_dir.GetFullPath(hItem); gibt einen CString zurück.</p>
</blockquote>
<p>dann ist ja alles klar...</p>
<p>- GetFullpath gibt einen <strong>temporären</strong> CString zurück<br />
- der CString::operator LPCTSTR gibt einen char const * auf die String-Daten zurück<br />
- der temporäre CString wird zerstört<br />
- m_strPath zeigt auf deallozierten Speicher</p>
<p>entweder m_strPath zu CString machen (empfehlenswert), oder das GetFullPath-Ergebnis in einer lokalen CString-Variable zwischenspeichern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/395129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/395129</guid><dc:creator><![CDATA[peterchen]]></dc:creator><pubDate>Sun, 16 Nov 2003 12:12:22 GMT</pubDate></item><item><title><![CDATA[Reply to Übergabe eines CStrings an ein 2. Dialogfeld on Sun, 16 Nov 2003 16:22:04 GMT]]></title><description><![CDATA[<p>Wow geil danke es funktioniert!<br />
Aber frag mich bitte nicht wie ich auf die Schnapsidee gekommen bin ausm_strPath einen const char* zu machen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/395305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/395305</guid><dc:creator><![CDATA[Herr der Dinge]]></dc:creator><pubDate>Sun, 16 Nov 2003 16:22:04 GMT</pubDate></item></channel></rss>