<?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[.exe mit parameter starten, probleme mit lpCmdLine[i] Ausgabe]]></title><description><![CDATA[<p>moin,<br />
ich frage per lpCmdLine[1] .... lpCmdLine[n] mehrere Parameter ab, welche ich beim start der .exe übergebe.</p>
<p>in meinem c++ programm will ich diese argumente jetzt verwenden.</p>
<pre><code class="language-cpp">int WINAPI WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR lpCmdLine,
                     int nCmdShow)
{

.
.
.
   std::fstream Datei(&quot;zvei.txt&quot;, std::ios::app);
    Datei &lt;&lt; timeString;
    Datei &lt;&lt; &quot;:&quot;;
    Datei &lt;&lt; lpCmdLine[1]
    Datei &lt;&lt; &quot;:&quot;;
    Datei &lt;&lt; lpCmdLine[2];
    Datei &lt;&lt; &quot;:&quot;;
    Datei &lt;&lt; lpCmdLine[3];
    Datei &lt;&lt; &quot;\n&quot;;

    return 0;
}
</code></pre>
<p>der aufruf der .exe geht über eine verknüpfung mit den parametern:</p>
<pre><code>test.exe param1 param2 param3
</code></pre>
<p>er erstell die .txt und schreibt auch die parameter rein, jedoch vergisst er die :</p>
<p>die ausgabe sieht also folgendermaßen aus:</p>
<pre><code>20090407101028:param1 param2 param3
</code></pre>
<p>sollte aber so aussehen:</p>
<pre><code>20090407101028:param1:param2:param3
</code></pre>
<p>weiss jemand, woran das liegt?<br />
Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/238143/exe-mit-parameter-starten-probleme-mit-lpcmdline-i-ausgabe</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 01:14:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/238143.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Apr 2009 08:38:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to .exe mit parameter starten, probleme mit lpCmdLine[i] Ausgabe on Tue, 07 Apr 2009 08:38:38 GMT]]></title><description><![CDATA[<p>moin,<br />
ich frage per lpCmdLine[1] .... lpCmdLine[n] mehrere Parameter ab, welche ich beim start der .exe übergebe.</p>
<p>in meinem c++ programm will ich diese argumente jetzt verwenden.</p>
<pre><code class="language-cpp">int WINAPI WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR lpCmdLine,
                     int nCmdShow)
{

.
.
.
   std::fstream Datei(&quot;zvei.txt&quot;, std::ios::app);
    Datei &lt;&lt; timeString;
    Datei &lt;&lt; &quot;:&quot;;
    Datei &lt;&lt; lpCmdLine[1]
    Datei &lt;&lt; &quot;:&quot;;
    Datei &lt;&lt; lpCmdLine[2];
    Datei &lt;&lt; &quot;:&quot;;
    Datei &lt;&lt; lpCmdLine[3];
    Datei &lt;&lt; &quot;\n&quot;;

    return 0;
}
</code></pre>
<p>der aufruf der .exe geht über eine verknüpfung mit den parametern:</p>
<pre><code>test.exe param1 param2 param3
</code></pre>
<p>er erstell die .txt und schreibt auch die parameter rein, jedoch vergisst er die :</p>
<p>die ausgabe sieht also folgendermaßen aus:</p>
<pre><code>20090407101028:param1 param2 param3
</code></pre>
<p>sollte aber so aussehen:</p>
<pre><code>20090407101028:param1:param2:param3
</code></pre>
<p>weiss jemand, woran das liegt?<br />
Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1692111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1692111</guid><dc:creator><![CDATA[codeman2001]]></dc:creator><pubDate>Tue, 07 Apr 2009 08:38:38 GMT</pubDate></item><item><title><![CDATA[Reply to .exe mit parameter starten, probleme mit lpCmdLine[i] Ausgabe on Tue, 07 Apr 2009 08:41:25 GMT]]></title><description><![CDATA[<p>das ist nur ein string. musst du selber trennen. oder __argv benutzen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1692112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1692112</guid><dc:creator><![CDATA[------]]></dc:creator><pubDate>Tue, 07 Apr 2009 08:41:25 GMT</pubDate></item><item><title><![CDATA[Reply to .exe mit parameter starten, probleme mit lpCmdLine[i] Ausgabe on Tue, 07 Apr 2009 08:47:58 GMT]]></title><description><![CDATA[<p>wie, das ist nur ein string?</p>
<p>ipcmdline[i] gibt es also gar nicht? welches element ist denn der gesamte string?</p>
<p>wie würde es mit __argv gehen?</p>
<p>gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1692116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1692116</guid><dc:creator><![CDATA[codeman2001]]></dc:creator><pubDate>Tue, 07 Apr 2009 08:47:58 GMT</pubDate></item><item><title><![CDATA[Reply to .exe mit parameter starten, probleme mit lpCmdLine[i] Ausgabe on Tue, 07 Apr 2009 09:01:42 GMT]]></title><description><![CDATA[<p>alles klar. habs verstanden...</p>
<p>ipcmdline ist der gesamte string! dankeschön</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1692127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1692127</guid><dc:creator><![CDATA[codeman2001]]></dc:creator><pubDate>Tue, 07 Apr 2009 09:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to .exe mit parameter starten, probleme mit lpCmdLine[i] Ausgabe on Tue, 07 Apr 2009 12:39:04 GMT]]></title><description><![CDATA[<p>hi,<br />
gibt es eine funktion, ähnlich dem substr() um die zeichenkette an einer bestimmten stelle in eine andere zu speichern?</p>
<p>quasi substr() für char.. oder muss ich mir das selber bauen?</p>
<p>gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1692292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1692292</guid><dc:creator><![CDATA[codeman2001]]></dc:creator><pubDate>Tue, 07 Apr 2009 12:39:04 GMT</pubDate></item></channel></rss>