<?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[Parameterübergabe (ParamStr())]]></title><description><![CDATA[<p>Hi, möchte an mein Programm einen Parameter übergeben.<br />
Der Parameter wird angehängt wenn ich eine datei öffne,<br />
mit der das Programm gestartet wird.</p>
<p>also z.b. : test.ewc wird geöffnet.<br />
Der Parameter ist dann z.b.: C:\test.ewc</p>
<p>Das klappt auch alles super.<br />
Nur wenn die Datei auf C:\Dokumente und Einstellungen\Administrator\Desktop\test.ewc<br />
liegt, dass speichert ParamStr(1) irgendwie nur C:\Dokumente</p>
<p>Das kann doch nicht sein das des bei Leerzeichen nicht geht..</p>
<p>Hier ein Programmausschnitt:</p>
<pre><code class="language-cpp">char settingfile[MAX_PATH];
char buffer[MAX_PATH];

GetModuleFileName(NULL, (LPSTR)settingfile, MAX_PATH);
strcpy(strrchr((char *)settingfile, '\\')+1, &quot;settings.ini&quot;);
int id = GetPrivateProfileInt(&quot;FileRegistration&quot;,&quot;ID&quot;,1,settingfile);

if(id == 0)
{
        if(!CreateFileAssociation(&quot;ewc&quot;,&quot;eWallet Cryptware Datei&quot;,&quot;&quot;,&quot;&quot;,0,true))
                ShowMessage(&quot;Dateityp konnte nicht registriert werden !&quot;);
                WritePrivateProfileString(&quot;FileRegistration&quot;,&quot;ID&quot;,&quot;1&quot;,settingfile);
}

if(ParamCount() == 1)
{
        datei_normal-&gt;Lines-&gt;LoadFromFile(ParamStr(1));
        sprintf(buffer,&quot;%s - eWallet Crypware v1.0&quot;,ExtractFileName(ParamStr(1)));
        Main-&gt;Caption=buffer;
}
else
{

        sprintf(buffer,&quot;Unbenannt - eWallet Crypware v1.0&quot;);
        Main-&gt;Caption=buffer;
}
</code></pre>
<p>BITTE UM HILFE <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/topic/91177/parameterübergabe-paramstr</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 07:47:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/91177.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Nov 2004 17:26:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Parameterübergabe (ParamStr()) on Fri, 05 Nov 2004 17:29:24 GMT]]></title><description><![CDATA[<p>Hi, möchte an mein Programm einen Parameter übergeben.<br />
Der Parameter wird angehängt wenn ich eine datei öffne,<br />
mit der das Programm gestartet wird.</p>
<p>also z.b. : test.ewc wird geöffnet.<br />
Der Parameter ist dann z.b.: C:\test.ewc</p>
<p>Das klappt auch alles super.<br />
Nur wenn die Datei auf C:\Dokumente und Einstellungen\Administrator\Desktop\test.ewc<br />
liegt, dass speichert ParamStr(1) irgendwie nur C:\Dokumente</p>
<p>Das kann doch nicht sein das des bei Leerzeichen nicht geht..</p>
<p>Hier ein Programmausschnitt:</p>
<pre><code class="language-cpp">char settingfile[MAX_PATH];
char buffer[MAX_PATH];

GetModuleFileName(NULL, (LPSTR)settingfile, MAX_PATH);
strcpy(strrchr((char *)settingfile, '\\')+1, &quot;settings.ini&quot;);
int id = GetPrivateProfileInt(&quot;FileRegistration&quot;,&quot;ID&quot;,1,settingfile);

if(id == 0)
{
        if(!CreateFileAssociation(&quot;ewc&quot;,&quot;eWallet Cryptware Datei&quot;,&quot;&quot;,&quot;&quot;,0,true))
                ShowMessage(&quot;Dateityp konnte nicht registriert werden !&quot;);
                WritePrivateProfileString(&quot;FileRegistration&quot;,&quot;ID&quot;,&quot;1&quot;,settingfile);
}

if(ParamCount() == 1)
{
        datei_normal-&gt;Lines-&gt;LoadFromFile(ParamStr(1));
        sprintf(buffer,&quot;%s - eWallet Crypware v1.0&quot;,ExtractFileName(ParamStr(1)));
        Main-&gt;Caption=buffer;
}
else
{

        sprintf(buffer,&quot;Unbenannt - eWallet Crypware v1.0&quot;);
        Main-&gt;Caption=buffer;
}
</code></pre>
<p>BITTE UM HILFE <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/645637</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/645637</guid><dc:creator><![CDATA[Crox]]></dc:creator><pubDate>Fri, 05 Nov 2004 17:29:24 GMT</pubDate></item><item><title><![CDATA[Reply to Parameterübergabe (ParamStr()) on Fri, 05 Nov 2004 17:58:00 GMT]]></title><description><![CDATA[<p>Das ist NORMAL ( bei Windoof)!!!</p>
<p>Parameter, die Leerzeichen enthalten muessen in &quot;&quot; eingeschlossen uebergeben werden, sonst wird an den Stellen in mehrere Parameter getrennt!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/645658</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/645658</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Fri, 05 Nov 2004 17:58:00 GMT</pubDate></item><item><title><![CDATA[Reply to Parameterübergabe (ParamStr()) on Fri, 05 Nov 2004 18:00:05 GMT]]></title><description><![CDATA[<p>Der übergebene Pfad muss in Anführungszeichen eingeschlossen sein.<br />
Genauso wie z.B. der Ziel-Eintrag bei Verknüpfungen auf dem Windows-Desktop.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/645661</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/645661</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Fri, 05 Nov 2004 18:00:05 GMT</pubDate></item><item><title><![CDATA[Reply to Parameterübergabe (ParamStr()) on Fri, 05 Nov 2004 18:00:50 GMT]]></title><description><![CDATA[<p>und wie kann ich das machen?</p>
<p>Ich kann doch schlecht den Parameter ändern...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/645662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/645662</guid><dc:creator><![CDATA[Crox]]></dc:creator><pubDate>Fri, 05 Nov 2004 18:00:50 GMT</pubDate></item><item><title><![CDATA[Reply to Parameterübergabe (ParamStr()) on Fri, 05 Nov 2004 18:05:50 GMT]]></title><description><![CDATA[<p>Hey Klasse, ich habs geschafft,<br />
hätte ich auch selbst drauf kommen können...</p>
<p>Danke vielmals...</p>
<p>Hab um das Parameterzeichen in der Regitry einfach &quot; gemacht.</p>
<p>Crox</p>
]]></description><link>https://www.c-plusplus.net/forum/post/645665</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/645665</guid><dc:creator><![CDATA[Crox]]></dc:creator><pubDate>Fri, 05 Nov 2004 18:05:50 GMT</pubDate></item><item><title><![CDATA[Reply to Parameterübergabe (ParamStr()) on Fri, 05 Nov 2004 18:06:02 GMT]]></title><description><![CDATA[<p>Das liegt in der Verantwortung des Anwenders. Wenn er den Pfad &quot;händisch&quot; übergibt muss er explizit Anführungszeichen setzen. Beim Übergeben per Drag'nDrop macht das der Explorer automatisch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/645666</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/645666</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Fri, 05 Nov 2004 18:06:02 GMT</pubDate></item></channel></rss>