<?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[Datei einlesen und in Zwischenablage kopieren]]></title><description><![CDATA[<p>warum funzt das net????</p>
<p>will die ganze datei in einem std::string oder halt stringstream einlesen.... u in messagebox ausgeben..</p>
<pre><code class="language-cpp">ifstream Datei(&quot;Message.txt&quot;);
	   stringstream text;

	   //Datei.open(&quot;Message.txt&quot;);
	   if(Datei.is_open)
	   {
		   while(!Datei.eof())
		   {
			   text &lt;&lt; Datei;
		   }
	   }

	   MessageBox(0, text.str().c_str(),&quot;Datei&quot;, MB_OK);
</code></pre>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/81290/datei-einlesen-und-in-zwischenablage-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 14:23:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/81290.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jul 2004 23:08:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 09:37:05 GMT]]></title><description><![CDATA[<p>warum funzt das net????</p>
<p>will die ganze datei in einem std::string oder halt stringstream einlesen.... u in messagebox ausgeben..</p>
<pre><code class="language-cpp">ifstream Datei(&quot;Message.txt&quot;);
	   stringstream text;

	   //Datei.open(&quot;Message.txt&quot;);
	   if(Datei.is_open)
	   {
		   while(!Datei.eof())
		   {
			   text &lt;&lt; Datei;
		   }
	   }

	   MessageBox(0, text.str().c_str(),&quot;Datei&quot;, MB_OK);
</code></pre>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/571293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571293</guid><dc:creator><![CDATA[coder1]]></dc:creator><pubDate>Fri, 30 Jul 2004 09:37:05 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Thu, 29 Jul 2004 23:36:48 GMT]]></title><description><![CDATA[<p>habs so gelöst:</p>
<pre><code class="language-cpp">ifstream datei(&quot;Message.txt&quot;, ios::binary);

	   if (datei) /* Fehler, Datei putt */
	   {
	       datei.seekg(0, ios::end);
	       std::vector&lt;char&gt; buffer(datei.tellg());
	       datei.seekg(0, ios::beg);
           datei.read(&amp;buffer[0], buffer.size());
           //datei.push_back('\0');

           std::string text(buffer.begin(), buffer.end());

	       MessageBox(0, text.c_str(),&quot;Datei&quot;, MB_OK); 

		   // Textdatei schließen
	       datei.close();
	   }
</code></pre>
<p>wie würdet ihr das machen???<br />
wie kann ich jetzt den text in std::string text in die zwischenablage kopieren????</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/571298</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571298</guid><dc:creator><![CDATA[coder1]]></dc:creator><pubDate>Thu, 29 Jul 2004 23:36:48 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 07:04:40 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/dataexchange/clipboard.asp" rel="nofollow">MSDN: Clipboard</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/571345</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571345</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Fri, 30 Jul 2004 07:04:40 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 08:11:47 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt; 
#include &lt;string&gt; 

// ... 

int main() 
{ 
    std::string text; 
    std::cin &gt;&gt; text; 
    SetClipboardText(text.c_str()); 
}
</code></pre>
<p>habs das beim suchen da gefunden! is das so einfach???</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/571392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571392</guid><dc:creator><![CDATA[coder1]]></dc:creator><pubDate>Fri, 30 Jul 2004 08:11:47 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 08:13:24 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt; 

BOOL SetClipboardText(LPCTSTR lpszInputText) { 
    if(OpenClipboard(NULL) == FALSE) { 
        return FALSE; 
    } 

    if(EmptyClipboard() == FALSE) { 
        CloseClipboard(); 
        return FALSE; 
    } 

    HGLOBAL hMemory = GlobalAlloc(GMEM_MOVEABLE, (lstrlen(lpszInputText) + 1) * sizeof(TCHAR)); 
    if(hMemory == NULL) { 
        CloseClipboard(); 
        return FALSE; 
    } 

    LPTSTR lpszText = (LPTSTR) GlobalLock(hMemory); 
    if(lpszText == NULL) { 
        GlobalFree(hMemory); 
        CloseClipboard(); 
        return FALSE; 
    } 

    if(lstrcpy(lpszText, lpszInputText) == NULL) { 
        GlobalUnlock(hMemory); 
        GlobalFree(hMemory); 
        CloseClipboard(); 
        return FALSE; 
    } 

#ifdef UNICODE 
    if(SetClipboardData(CF_UNICODETEXT, hMemory) == NULL) { 
#else 
    if(SetClipboardData(CF_TEXT, hMemory) == NULL) { 
#endif 
        GlobalUnlock(hMemory); 
        GlobalFree(hMemory); 
        CloseClipboard(); 
        return FALSE; 
    } 

    if(GlobalUnlock(hMemory) == FALSE) { 
        if(GetLastError() != NO_ERROR) { 
            GlobalFree(hMemory); 
            CloseClipboard(); 
            return FALSE; 
        } 
    } 

    if(GlobalFree(hMemory) != NULL) { 
        CloseClipboard(); 
        return FALSE; 
    } 

    if(CloseClipboard() == FALSE) { 
        return FALSE; 
    } 

    return TRUE; 
}
</code></pre>
<p>das gehört noch dazu;-)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/571393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571393</guid><dc:creator><![CDATA[coder1]]></dc:creator><pubDate>Fri, 30 Jul 2004 08:13:24 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 08:46:49 GMT]]></title><description><![CDATA[<p>Für den nächsten Thread wäre eine passende Überschrift nicht schlecht!</p>
<p>Gruß Skay</p>
]]></description><link>https://www.c-plusplus.net/forum/post/571422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571422</guid><dc:creator><![CDATA[Skay]]></dc:creator><pubDate>Fri, 30 Jul 2004 08:46:49 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 09:12:07 GMT]]></title><description><![CDATA[<p>Skay schrieb:</p>
<blockquote>
<p>Für den nächsten Thread wäre eine passende Überschrift nicht schlecht!</p>
<p>Gruß Skay</p>
</blockquote>
<p>ok ja! aber ich kann den titel nicht mehr ändern!<br />
titel: Datei einlesen und in Zwischenablage kopieren</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/571444</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571444</guid><dc:creator><![CDATA[Coder1]]></dc:creator><pubDate>Fri, 30 Jul 2004 09:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 09:37:42 GMT]]></title><description><![CDATA[<p>done <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/571471</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571471</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Fri, 30 Jul 2004 09:37:42 GMT</pubDate></item><item><title><![CDATA[Reply to Datei einlesen und in Zwischenablage kopieren on Fri, 30 Jul 2004 09:41:32 GMT]]></title><description><![CDATA[<p>flenders schrieb:</p>
<blockquote>
<p>done <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>
</blockquote>
<p>ich hoff das beispiel da funktioniert, sonst wird es dem titel nicht gerecht;-)<br />
muss mal am nachmittag compelieren;-)</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/571478</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/571478</guid><dc:creator><![CDATA[coder1]]></dc:creator><pubDate>Fri, 30 Jul 2004 09:41:32 GMT</pubDate></item></channel></rss>