<?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[HANDLE of an open file]]></title><description><![CDATA[<p>schönen guten Morgen...</p>
<p>Mein Problem:<br />
mit<br />
CStdioFile filei;<br />
filei.Open(TEXT(&quot;path+filename&quot;), _ CFile::modeReadWrite|CFile::shareExclusive|CFile::typeBinary, &amp;fileException))<br />
habe ich eine Datei geöffnet</p>
<p>jetzt kommt code<br />
...<br />
...</p>
<p>jetzt möchte ich den HANDEL der oben geöffneten Datei -&gt;<br />
um diesen einer Funktion zu übergeben.</p>
<p>Wie erhalte ich den HANDLE?</p>
<p>Für Antworten danke ich schon mal im voraus.<br />
Rolf</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162199/handle-of-an-open-file</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 22:58:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162199.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Oct 2006 09:43:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 09:53:25 GMT]]></title><description><![CDATA[<p>schönen guten Morgen...</p>
<p>Mein Problem:<br />
mit<br />
CStdioFile filei;<br />
filei.Open(TEXT(&quot;path+filename&quot;), _ CFile::modeReadWrite|CFile::shareExclusive|CFile::typeBinary, &amp;fileException))<br />
habe ich eine Datei geöffnet</p>
<p>jetzt kommt code<br />
...<br />
...</p>
<p>jetzt möchte ich den HANDEL der oben geöffneten Datei -&gt;<br />
um diesen einer Funktion zu übergeben.</p>
<p>Wie erhalte ich den HANDLE?</p>
<p>Für Antworten danke ich schon mal im voraus.<br />
Rolf</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155541</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155541</guid><dc:creator><![CDATA[Rolf_VIII]]></dc:creator><pubDate>Mon, 16 Oct 2006 09:53:25 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 09:47:06 GMT]]></title><description><![CDATA[<p>Compiler, OS ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155548</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Mon, 16 Oct 2006 09:47:06 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 09:49:09 GMT]]></title><description><![CDATA[<p>Was willst du denn mit diesem HANLDE machen, was nicht direkt mit deinem File geht?</p>
<p>*nachsieht* laut MSDN hast du dein File-Handle in dem Member <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cstdiofile.3a3a.m_pstream.asp" rel="nofollow">m_pStream</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155550</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 16 Oct 2006 09:49:09 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 10:11:23 GMT]]></title><description><![CDATA[<p>Den HANDLE möchte ich einer Funktion übergeben in der</p>
<p>WriteFile( hFile,... )</p>
<p>verwenden wird.</p>
<p>XP, VS6.0</p>
<p>--&gt;<br />
mit<br />
HANDLE hFile = fileo.m_pStream;<br />
WriteFile( hFile,... ) //nicht erfolgreich!<br />
DWORD dwGLError = GetLastError();<br />
erhalte ich:<br />
The handle is invalid. ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155553</guid><dc:creator><![CDATA[Rolf_VIII]]></dc:creator><pubDate>Mon, 16 Oct 2006 10:11:23 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 11:02:58 GMT]]></title><description><![CDATA[<p>Rolf_VIII schrieb:</p>
<blockquote>
<p>Den HANDLE möchte ich einer Funktion übergeben in der</p>
<p>WriteFile( hFile,... )<br />
....</p>
</blockquote>
<p>Mal ein Tipp: Ist das Handle evtl. nicht (standard-)kopierbar ?<br />
Wenn WriteFile() statt einer Kopie eine Referenz übernähme, könnte es vllt. gehen.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155609</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Mon, 16 Oct 2006 11:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 11:08:01 GMT]]></title><description><![CDATA[<p>vielleicht verstehe ich ja was falsch, aber<br />
ich dachte ein Handle ist keine Kopie sondern ein Zeiger auf das Original.<br />
Und diesen Zeiger hätte ich der Funktion übergeben, damit sie weiss in welche Datei sie etwas schreiben muss...</p>
<p>Rolf</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155615</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155615</guid><dc:creator><![CDATA[Rolf_VIII]]></dc:creator><pubDate>Mon, 16 Oct 2006 11:08:01 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 11:10:12 GMT]]></title><description><![CDATA[<p>Muß es denn unbedingt WriteFile() sein? CFile (und damit auch CStdioFile) hat doch seine eigene Write()-Methode für so etwas.</p>
<p>Eidt: Und ein Handle ist nicht unbedingt ein Zeiger. Das ist mehr eine Art Marker, mit der die Systemfunktionen ihre Objekte wiedererkennen können (was genau dahintersteht, weiß nur das Programm).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155616</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 16 Oct 2006 11:10:12 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 11:13:05 GMT]]></title><description><![CDATA[<p>nein, natürlich muss es nicht unbedingt WriteFile sein.<br />
Allerdings kenn ich die von Dir erwähnten Funktionen nicht.<br />
Muss mich also erst einlesen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155621</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155621</guid><dc:creator><![CDATA[Rolf_VIII]]></dc:creator><pubDate>Mon, 16 Oct 2006 11:13:05 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 11:25:20 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=1" rel="nofollow">MFC (Visual C++)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155632</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155632</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 16 Oct 2006 11:25:20 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 12:38:03 GMT]]></title><description><![CDATA[<p>m_pStream ist ein FILE*, da wird denke ich niemals ein HANDLE drinnen stehen.<br />
Bei CFile ist in m_hFile in normales Win32 HANDLE zu finden, ob das bei CStdioFile auch noch so ist weiss ich nicht, einfach im Source nachgucken macht in dem Fall schlau.</p>
<p>Bei MFC 4-6 musst du das m_hFile noch auf HANDLE casten, ab MFC 7 oder 8 isses dann von Haus aus ein HANDLE.</p>
<p>Aber achtung: CFile ist eine abstrakte Basisklasse. Hat zwar eine default Implementierung die mit normalen KERNEL32 Files arbeitet, aber Klassen wie z.B. CMemFile tun das nicht und haben daher auch niemals ein HANDLE oder sonstwas in der Art in m_hFile stehen. Wer also hergeht und irgendwo m_hFile ausliest und damit arbeitet verbaut sich damit auch automatisch die Möglichkeit dass die Funktion/das Modul wo er das so macht mit CMemFile oder CHttpFile oder was ähnlichem verwendet werden kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155684</guid><dc:creator><![CDATA[Plotzenhotz]]></dc:creator><pubDate>Mon, 16 Oct 2006 12:38:03 GMT</pubDate></item><item><title><![CDATA[Reply to HANDLE of an open file on Mon, 16 Oct 2006 13:09:43 GMT]]></title><description><![CDATA[<p>jep, das wars...</p>
<p>Danke Plotzenhotz damit hats funktioniert. Und da ich im Moment mal davon ausgehe, dass ich &quot;CMemFile oder CHttpFile oder ..&quot; nicht brauche, ist das ja egal.</p>
<p>Danke auch den anderen.<br />
Mit der Variante von CFile hats auch funktioniert.</p>
<p>Rolf</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155712</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155712</guid><dc:creator><![CDATA[Rolf_VIII]]></dc:creator><pubDate>Mon, 16 Oct 2006 13:09:43 GMT</pubDate></item></channel></rss>