<?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[Textdateien unter MFC C++ schreibschützen....?]]></title><description><![CDATA[<p>Morgens!!</p>
<p>müsste textdateien schreibschützen und nachher wieder schreibschutz entfernen.<br />
wie stelle ich das an?? <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>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/57246/textdateien-unter-mfc-c-schreibschützen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 02 Jun 2026 12:09:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/57246.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Dec 2003 07:33:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 07:33:59 GMT]]></title><description><![CDATA[<p>Morgens!!</p>
<p>müsste textdateien schreibschützen und nachher wieder schreibschutz entfernen.<br />
wie stelle ich das an?? <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>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/406971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/406971</guid><dc:creator><![CDATA[Guenter Mies]]></dc:creator><pubDate>Wed, 03 Dec 2003 07:33:59 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 07:45:41 GMT]]></title><description><![CDATA[<p>Moin,</p>
<p>bin nicht der einzigste der nen Kaffee braucht *fg*. Gucke mal, habe das in der MSDN gefunden:</p>
<blockquote>
<p>BOOL SetFileAttributes(<br />
LPCTSTR lpFileName,<br />
DWORD dwFileAttributes<br />
);</p>
<p>Parameters<br />
lpFileName<br />
[in] Pointer to a string that specifies the name of the file whose attributes are to be set.<br />
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend &quot;\?\&quot; to the path. For more information, see Naming a File.</p>
<p>Windows Me/98/95: This string must not exceed MAX_PATH characters.</p>
<p>dwFileAttributes<br />
[in] File attributes to set for the file. This parameter can be one or more of the following values. However, all other values override FILE_ATTRIBUTE_NORMAL. Attribute Meaning<br />
FILE_ATTRIBUTE_ARCHIVE The file is an archive file. Applications use this attribute to mark files for backup or removal.<br />
FILE_ATTRIBUTE_HIDDEN The file is hidden. It is not included in an ordinary directory listing.<br />
FILE_ATTRIBUTE_NORMAL The file has no other attributes set. This attribute is valid only if used alone.<br />
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED The file will not be indexed by the content indexing service.<br />
FILE_ATTRIBUTE_OFFLINE The data of the file is not immediately available. This attribute indicates that the file data has been physically moved to offline storage. This attribute is used by Remote Storage, the hierarchical storage management software. Applications should not arbitrarily change this attribute.<br />
FILE_ATTRIBUTE_READONLY The file is read-only. Applications can read the file but cannot write to it or delete it.<br />
FILE_ATTRIBUTE_SYSTEM The file is part of the operating system or is used exclusively by it.<br />
FILE_ATTRIBUTE_TEMPORARY The file is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because often the application deletes the temporary file shortly after the handle is closed. In that case, the system can entirely avoid writing the data. Otherwise, the data will be written after the handle is closed.</p>
</blockquote>
<p>*winke*</p>
<p>Hellsgore</p>
]]></description><link>https://www.c-plusplus.net/forum/post/406976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/406976</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Wed, 03 Dec 2003 07:45:41 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 07:53:58 GMT]]></title><description><![CDATA[<p>leider verstehe ich diesen kram hier nicht so ganz...fange grad damit an</p>
<p>BOOL SetFileAttributes( LPCTSTR lpFileName, DWORD dwFileAttributes );</p>
<p>was mir kopfschmerzen bereitet ist dieses LPCTSTR</p>
<p>was fuer ne art von string ist das?</p>
<p>werde auch im netz mal schaun..!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>danke dir!!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/406988</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/406988</guid><dc:creator><![CDATA[Guenter Mies]]></dc:creator><pubDate>Wed, 03 Dec 2003 07:53:58 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:09:08 GMT]]></title><description><![CDATA[<p>Guenter Mies schrieb:</p>
<blockquote>
<p>leider verstehe ich diesen kram hier nicht so ganz...fange grad damit an</p>
<p>BOOL SetFileAttributes( LPCTSTR lpFileName, DWORD dwFileAttributes );</p>
<p>was mir kopfschmerzen bereitet ist dieses LPCTSTR</p>
</blockquote>
<p>LP = Long-Pointer<br />
CT = Konstante<br />
STR = String</p>
]]></description><link>https://www.c-plusplus.net/forum/post/407001</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407001</guid><dc:creator><![CDATA[Zeus]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:09:08 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:10:36 GMT]]></title><description><![CDATA[<p>verdammter pointerkram....werd ich NIE verstehen</p>
<p>ohne koennte das leben so einfach sein!!!!</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/407004</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407004</guid><dc:creator><![CDATA[Guenter Mies]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:10:36 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:14:28 GMT]]></title><description><![CDATA[<p>Ist en Charpointer,<br />
pass auf<br />
machst das am besten so:</p>
<pre><code class="language-cpp">//Hast wahrscheinlich den Pfad in einem CString stehen
CString strPfad = &quot;C:\\DeinPfad\\DeineDatei.txt&quot;
TCHAR cPfad[255];
memset(cPfad, 0, sizeof(cPfad));

strcpy(cPfad, strPfad);
//ab hier hast du allesin cPfad stehen das nimmste jetzt und:

//Versteckt und schreibgeschützt setzen
::SetFileAttributes(cPfad, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN);
</code></pre>
<p>Ach ich Ulles ich sehe gerade du brauchst garnicht den string in den char zu kopieren das geht auch so mit dem CString. Klar ich habe den Datentyp nicht beobachtet (LPCTSTR &gt; konstant)*g* aber klappt auch so...</p>
<p>*winke*<br />
Hellsgore</p>
]]></description><link>https://www.c-plusplus.net/forum/post/407006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407006</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:14:28 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:20:43 GMT]]></title><description><![CDATA[<p>also ich habe diese paar zeilen und kriege es nicht gebacken.... schande über mich<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
<p>CString Dateiname =&quot;Daten\\Neukunden\&quot; + m_MatrixOffeneAnfragen[m_zahl][0] +&quot;KDneu.txt&quot;;<br />
CFile datei(Dateiname, CFile::modeCreate |CFile::modeWrite );<br />
datei.Write(str,laenge);</p>
<p>//////SCHREIBSCHUTZ<br />
BOOL SetFileAttributes(Dateiname, FILE_ATTRIBUTE_READONLY);<br />
//////</p>
<p>datei.Close();<br />
UpdateData(false);</p>
<p>helft mir bitte!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/407012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407012</guid><dc:creator><![CDATA[Guenter Mies]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:20:43 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:23:29 GMT]]></title><description><![CDATA[<p>Gucke:</p>
<pre><code class="language-cpp">CString Dateiname =&quot;Daten\\Neukunden\\&quot; + m_MatrixOffeneAnfragen[m_zahl][0] +&quot;KDneu.txt&quot;; 
CFile datei(Dateiname, CFile::modeCreate |CFile::modeWrite ); 
datei.Write(str,laenge); 

//////SCHREIBSCHUTZ 
::SetFileAttributes(Dateiname, FILE_ATTRIBUTE_READONLY); //da war der Fehler
DWORD dwError = GetLastError();
//wenns noch einen Fehler gibt durchdebuggen und in dwError gucken
////// 

datei.Close(); 
UpdateData(false);
</code></pre>
<p>*winke*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/407014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407014</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:25:06 GMT]]></title><description><![CDATA[<p>Ja Moment geht das so überhaupt?<br />
musste mal testen weiss das jetzt nicht so genau ob man attribute verändern kann während die Datei genutzt wird ich glaube aber nicht. Musst mal schauen wenn es einen Fehler gibt dann steht der bestimmt in dwError. Dann musst du die Attribute nachdem du die Datei geschlossen hast setzen.....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/407016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407016</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:25:06 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:26:48 GMT]]></title><description><![CDATA[<p>sorry hatte dein vorletztes posting noch nicht gesehen</p>
<p>VIELEN DANK AUCH!!!</p>
<p>wenn du mir nun noch mit dieser drecks dateikonvertierung helfen kannst wirst du auf ewig in meiner liste der hilfsbereiten superC++ler stehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/407017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407017</guid><dc:creator><![CDATA[Guenter Mies]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:26:48 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:31:38 GMT]]></title><description><![CDATA[<p>Hilfsbereit schon aber kein super c++ler *g*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/407020</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407020</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:31:38 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:32:58 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> sollte dich nicht von dem DATEIKONVERTIERUNGSPROB abhalten... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/407022</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407022</guid><dc:creator><![CDATA[Guenter Mies]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:32:58 GMT</pubDate></item><item><title><![CDATA[Reply to Textdateien unter MFC C++ schreibschützen....? on Wed, 03 Dec 2003 08:43:28 GMT]]></title><description><![CDATA[<p>SCHREIBSCHUTZ SO WIE IN DIESEN CODEZEILEN ANGEGEBEN FUNZT!!!!!!!!!!!</p>
<p>weltgroessten dank <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/407032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/407032</guid><dc:creator><![CDATA[Guenter Mies]]></dc:creator><pubDate>Wed, 03 Dec 2003 08:43:28 GMT</pubDate></item></channel></rss>