<?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[Kontrollkästchen mit Hilfe einer Configuration-Datei setzen]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Anwendung mit vielen Kontrollkästchen erstellt.<br />
Über einen Configuration-Button soll der Benutzer eine bestimmte Config-Datei laden, die die Kontrollkästchen entsprechend setzt.<br />
Hat jemand eine Idee, wie man so eine Datei erstellt!?<br />
Danke.</p>
<p>Gruß, jamina</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149738/kontrollkästchen-mit-hilfe-einer-configuration-datei-setzen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 05:00:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149738.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Jun 2006 19:33:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Thu, 08 Jun 2006 19:33:19 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Anwendung mit vielen Kontrollkästchen erstellt.<br />
Über einen Configuration-Button soll der Benutzer eine bestimmte Config-Datei laden, die die Kontrollkästchen entsprechend setzt.<br />
Hat jemand eine Idee, wie man so eine Datei erstellt!?<br />
Danke.</p>
<p>Gruß, jamina</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074136</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074136</guid><dc:creator><![CDATA[jamina]]></dc:creator><pubDate>Thu, 08 Jun 2006 19:33:19 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Thu, 08 Jun 2006 19:37:38 GMT]]></title><description><![CDATA[<p>Wo ist das Problem?! mit FILE oder nen stream gehts doch ganz einfach... als Tipp... seh das Kästchen als boolischen Wert <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/1074141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074141</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Thu, 08 Jun 2006 19:37:38 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Thu, 08 Jun 2006 19:38:34 GMT]]></title><description><![CDATA[<p>Vielleicht Nullen und Einsen verwenden (jeweils false und true)<br />
=&gt; einlesen<br />
=&gt; setzen der häkchen<br />
Eine Datei sieht dann so aus:</p>
<pre><code>0 1 1 0 1 0 1 0 0
</code></pre>
<p>jede Zahl einzeln einlesen und wenn 1 =&gt; häkchen dran wenn 0 eben nicht oder häkchen entfernen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074142</guid><dc:creator><![CDATA[SALOMON]]></dc:creator><pubDate>Thu, 08 Jun 2006 19:38:34 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Thu, 08 Jun 2006 19:55:44 GMT]]></title><description><![CDATA[<p>Tss... einfach so... also das ist jetzt mit FILE...</p>
<pre><code class="language-cpp">bool WriteCheckBoxSettings(LPCSTR lpszFile, CButton* pButton)
{
    FILE* pFile = NULL;
    pFile = fopen(lpszFile, &quot;wb&quot;);

    if(!pFile)
        return false;

    fwrite(&amp;pButton-&gt;GetCheck(), 1, 4, pFile);

    fclose(pFile);

    return true;
}
</code></pre>
<pre><code class="language-cpp">bool ReadCheckBoxSettings(LPCSTR lpszFile, CButton* pButton)
{
    FILE* pFile = NULL;
    pFile = fopen(lpszFile, &quot;wb&quot;);

    if(!pFile)
        return false;

    int nCheck = 0;
    fread(&amp;nCheck, 4, 1, pFile);

    pButton-&gt;SetCheck(nCheck);

    fclose(pFile);

    return true;
}
</code></pre>
<p><strong>Referenzen:</strong><br />
<a href="http://msdn.microsoft.com/library/en-us/vclib/html/_mfc_cbutton.3a3a.getcheck.asp" rel="nofollow">CButton::GetCheck</a><br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cbutton.3a3a.setcheck.asp" rel="nofollow">CButton::SetCheck</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074157</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074157</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Thu, 08 Jun 2006 19:55:44 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Thu, 08 Jun 2006 20:20:45 GMT]]></title><description><![CDATA[<p>Danke für die schnellen Antworten.<br />
Ob die enstsprechenden Kontrollkästchen gestetzt oder nicht gestetzt sind, will ich nicht direkt im Programm schreiben, sondern über eine Config-Datei laden.<br />
Was eine Endung soll dann die Datei haben?<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074177</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074177</guid><dc:creator><![CDATA[jamina]]></dc:creator><pubDate>Thu, 08 Jun 2006 20:20:45 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Thu, 08 Jun 2006 20:40:11 GMT]]></title><description><![CDATA[<p>du könntest das auch in einer Ini datei lösen.</p>
<p>zum tema Ini kuck mal in folgende links<br />
<a href="http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofileint.asp" rel="nofollow">http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofileint.asp</a> &lt;-- ints auslesen<br />
<a href="http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofilesection.asp" rel="nofollow">http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofilesection.asp</a> &lt;-- ganze Sektion auslesen.<br />
<a href="http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofilestring.asp" rel="nofollow">http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofilestring.asp</a> &lt;-- strings auslesen.</p>
<p>oder nutz das kleine beispiel</p>
<p>so setzt du werte in eine Ini</p>
<pre><code>CString sSection = &quot;MeineSection&quot;; 
CString sKey = &quot;MeinKey&quot;; 
CString sData = &quot;MeinWert&quot;; 
CString sPath = &quot;C:\\MeineIni.ini&quot;;

for(int nloop = 0;nloop&lt;=10;nloop++) 
{ 
     CString sNextSection; 
     sNextSection.Format(&quot;%s%i&quot;,sSection,nloop); 
     WritePrivateProfileString((LPCTSTR)sNextSection,(LPCTSTR)sKey,(LPCTSTR)sData,(LPCTSTR)sPath);

     for(int nloop2=0;nloop2&lt;=10;nloop2++) 
     { 
        CString sNextKey; 
        sNextKey.Format(&quot;%s%i&quot;,sKey,nloop2); 
        WritePrivateProfileString((LPCTSTR)sNextSection,(LPCTSTR)sNextKey,(LPCTSTR)sData,(LPCTSTR)sPath); 
     } 
}
</code></pre>
<p>und so rufts du sie wieder ab</p>
<pre><code>char cBufferSection[4096]=&quot;&quot;; 
char cBufferKey[4096]=&quot;&quot;; 
DWORD dwSecSize = sizeof(cBufferSection); 
DWORD dwKeySize = sizeof(cBufferKey); 
sPath = &quot;C:\\MeineIni.ini&quot;; 
sSection.Empty(); 
DWORD dwCountSection = GetPrivateProfileSectionNames((LPTSTR)cBufferSection, dwSecSize, (LPCTSTR)sPath);

for(DWORD dwloop=0;dwloop&lt;dwCountSection;dwloop++) 
{ 
     if(cBufferSection[dwloop]!='\0') 
         sSection+=cBufferSection[dwloop]; 
     else 
     { 
        DWORD dwCountKey = GetPrivateProfileSection((LPCTSTR)sSection,(LPTSTR)cBufferKey,dwKeySize,(LPCTSTR)sPath);

        CString sKeys; 
        for(DWORD dwloop2=0;dwloop2&lt;dwCountKey;dwloop2++) 
        { 
             if(cBufferKey[dwloop2]!='\0') 
                 sKeys+=cBufferKey[dwloop2]; 
             else 
                 sKeys+=&quot;,\n&quot;; 
         } 
          MessageBox(sKeys,sSection); 
          sSection.Empty(); 
         } 
 }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1074190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074190</guid><dc:creator><![CDATA[LowFly]]></dc:creator><pubDate>Thu, 08 Jun 2006 20:40:11 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Fri, 09 Jun 2006 14:25:31 GMT]]></title><description><![CDATA[<p>jamina... was meisnt du eigentlich was wir hir sind?! Meine Lösung ist genau das wonach du gefragt hast! Es speichert in eine Datei ob du die CheckBox angeklickt hast oder net und beim laden setzt es wieder den status.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074650</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074650</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Fri, 09 Jun 2006 14:25:31 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Fri, 09 Jun 2006 15:31:17 GMT]]></title><description><![CDATA[<p>Herzlichen Danke an euch allen<br />
@ Evil &gt;&gt; sorry, es war nicht so gemeint... ich dachte nur, dass ich mich vielleicht undeutlich ausgedrückt habe <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="🙂"
    /><br />
Gruß, jamina</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074692</guid><dc:creator><![CDATA[jamina]]></dc:creator><pubDate>Fri, 09 Jun 2006 15:31:17 GMT</pubDate></item><item><title><![CDATA[Reply to Kontrollkästchen mit Hilfe einer Configuration-Datei setzen on Sun, 11 Jun 2006 09:42:13 GMT]]></title><description><![CDATA[<blockquote>
<p>Was eine Endung soll dann die Datei haben?</p>
</blockquote>
<p>wie wäre es mit xxx.jam? <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="😉"
    /><br />
Wenn Du flexibel bleiben willst, kannst Du auch XML / TinyXML verwenden oder die Registry.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075467</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075467</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sun, 11 Jun 2006 09:42:13 GMT</pubDate></item></channel></rss>