<?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[Zugriffsverletzung bei CreateFile]]></title><description><![CDATA[<p>hallo,</p>
<p>wieso bekomme ich bei diesem Code eine Zugriffsverletzung???<br />
Die Datei existiert bereits.</p>
<pre><code>HANDLE hf = CreateFile(&quot;test.txt&quot;, GENERIC_READ, (DWORD)0, NULL, OPEN_ALWAYS,
                FILE_ATTRIBUTE_NORMAL+FILE_ATTRIBUTE_ARCHIVE, (HANDLE) NULL);
    FILETIME *ft;
    if(GetFileTime(hf, NULL, NULL, ft))
        Memo1-&gt;Lines-&gt;Add(IntToStr(ft));
</code></pre>
<p>danke für jede hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/116804/zugriffsverletzung-bei-createfile</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 14:38:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/116804.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 Jul 2005 11:32:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 11:32:41 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>wieso bekomme ich bei diesem Code eine Zugriffsverletzung???<br />
Die Datei existiert bereits.</p>
<pre><code>HANDLE hf = CreateFile(&quot;test.txt&quot;, GENERIC_READ, (DWORD)0, NULL, OPEN_ALWAYS,
                FILE_ATTRIBUTE_NORMAL+FILE_ATTRIBUTE_ARCHIVE, (HANDLE) NULL);
    FILETIME *ft;
    if(GetFileTime(hf, NULL, NULL, ft))
        Memo1-&gt;Lines-&gt;Add(IntToStr(ft));
</code></pre>
<p>danke für jede hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842587</guid><dc:creator><![CDATA[tuxman]]></dc:creator><pubDate>Sun, 31 Jul 2005 11:32:41 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 12:10:30 GMT]]></title><description><![CDATA[<p>FILE_ATTRIBUTE_NORMAL+FILE_ATTRIBUTE_ARCHIVE</p>
<p>...except all other file attributes override FILE_ATTRIBUTE_NORMAL.</p>
<p>(HANDLE) NULL stattdessen 0</p>
<p>ggf. hole das Fileattribut mit</p>
<pre><code class="language-cpp">DWORD att=GetFileAttributes(name);
	if(att==0xFFFFFFFF)
		att=FILE_ATTRIBUTE_NORMAL;
</code></pre>
<p>Ansonsten hol dir mit GetLast Error den Fehler und schau in der Liste nach.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842623</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842623</guid><dc:creator><![CDATA[christian211]]></dc:creator><pubDate>Sun, 31 Jul 2005 12:10:30 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 12:13:11 GMT]]></title><description><![CDATA[<blockquote>
<p>Memo1-&gt;Lines-&gt;Add(IntToStr(ft));</p>
</blockquote>
<p>Wozu dient diese Zeile??</p>
<p>Vielleicht</p>
<p>ileAge gibt den Zeitstempel des Betriebssystems von einer Datei zurück.</p>
<p>Unit</p>
<p>SysUtils</p>
<p>Kategorie</p>
<p>Dateiverwaltung</p>
<p>extern PACKAGE int __fastcall FileAge(const AnsiString FileName);</p>
<p>Beschreibung</p>
<p>Mit FileAge können Sie den Betriebssystem-Zeitstempel der in FileName angegebenen Datei ermitteln. Der Rückgabewert kann anschließend mit der Funktion FileDateToDateTime in ein TDateTime-Objekt konvertiert werden. Ist die angegebene Datei nicht vorhanden, wird der Wert -1 zurückgegeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842626</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842626</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Sun, 31 Jul 2005 12:13:11 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 13:23:14 GMT]]></title><description><![CDATA[<p>tuxman schrieb:</p>
<blockquote>
<p>wieso bekomme ich bei diesem Code eine Zugriffsverletzung?</p>
</blockquote>
<p>In welcher Zeile?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842676</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 31 Jul 2005 13:23:14 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 13:31:56 GMT]]></title><description><![CDATA[<p>Warum überprüfst du nicht die Rückgabewerte?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842683</guid><dc:creator><![CDATA[hmmmmm?]]></dc:creator><pubDate>Sun, 31 Jul 2005 13:31:56 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 15:47:31 GMT]]></title><description><![CDATA[<p>Danke für die Hilfe,</p>
<pre><code>HANDLE hf = CreateFile(&quot;test.txt&quot;, GENERIC_READ, (DWORD)0, NULL, OPEN_ALWAYS,
                FILE_ATTRIBUTE_NORMAL+FILE_ATTRIBUTE_ARCHIVE, (HANDLE) NULL);
    FILETIME *ft;
     :arrow: if(GetFileTime(hf, NULL, NULL, ft)) // Hier bekomme ich die Zugriffsverletzung
        Memo1-&gt;Lines-&gt;Add(IntToStr(ft)); // Diese Zeile dient nur mir zur überprüfung
</code></pre>
<p>Noch eine Frage: muss ich das Dateiattribut angeben, wenn die datei existiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842793</guid><dc:creator><![CDATA[tuxman]]></dc:creator><pubDate>Sun, 31 Jul 2005 15:47:31 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 15:53:04 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Keiner der Parameter für GetFileTime darf NULL sein, auch wenn du nur einen brauchst. Also drei gültige Adressen übergeben.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842798</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 31 Jul 2005 15:53:04 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 15:54:26 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">BOOL GetFileTime(

    HANDLE hFile,	// identifies the file 
    LPFILETIME lpCreationTime,	// address of creation time 
    LPFILETIME lpLastAccessTime,	// address of last access time  
    LPFILETIME lpLastWriteTime 	// address of last write time 
   );
</code></pre>
<p>LPFILETIME = Adresse</p>
<blockquote>
<p>muss ich das Dateiattribut angeben, wenn die datei existiert?</p>
</blockquote>
<p>Es steht nicht drin, dass das fehlen darf; im Windows SDK</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842800</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Sun, 31 Jul 2005 15:54:26 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 16:57:40 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=437" rel="nofollow">Jansen</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=2" rel="nofollow">VCL/CLX (Borland C++ Builder)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</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/842851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842851</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 31 Jul 2005 16:57:40 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Sun, 31 Jul 2005 18:40:36 GMT]]></title><description><![CDATA[<p>akari schrieb:</p>
<blockquote>
<p>Keiner der Parameter für GetFileTime darf NULL sein, auch wenn du nur einen brauchst. Also drei gültige Adressen übergeben.</p>
</blockquote>
<p>Das ist nicht korrekt. lpCreationTime, lpLastAccessTime und lpLastWriteTime dürfen durchaus NULL sein, sofern diese nicht gebraucht werden.<br />
Das Problem ist vielmehr, dass ft ein nicht initialisierter Zeiger ist. Der Op wollte wohl eher sowas</p>
<pre><code class="language-cpp">FILETIME ft;
    if(GetFileTime(hf, NULL, NULL, &amp;ft))
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/842951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842951</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Sun, 31 Jul 2005 18:40:36 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung bei CreateFile on Mon, 01 Aug 2005 09:54:16 GMT]]></title><description><![CDATA[<p>danke. ich habe es jetzt hinbekommen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/843289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/843289</guid><dc:creator><![CDATA[tuxman]]></dc:creator><pubDate>Mon, 01 Aug 2005 09:54:16 GMT</pubDate></item></channel></rss>