<?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[Probleme beim einlesen der Kommandozeile]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich wollte mir eine kleine Klasse schreiben die für mich das Einlesen und das Verarbeiten der Kommandozeilen-Parameter erledigt. Die Klasse sieht so aus:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;CMLParser.hpp&quot;

CMLParser::CMLParser(void) {	

}

CMLParser::CMLParser(LPSTR argv, int argn) {	
	CMLParser::lpCmdLine = argv;
	CMLParser::nCmdShow	= argn;
}

CMLParser::~CMLParser() {

}

bool 
CMLParser::verifyCML() {	
	if((CMLParser::nCmdShow) &gt; 1) {		
		return true;
	}

	return false;
}
</code></pre>
<p>Ihre Header-Datei:</p>
<pre><code class="language-cpp">#ifndef CMLParser_hpp
#define CMLParser_hpp CMLParser_hpp

class CMLParser {
	public:
		//default constructor
		CMLParser();

		//custom constructor
		CMLParser(LPSTR, int);

		//destructor
		~CMLParser();

		//verify that at least one parameter was supplied
		bool verifyCML(void);
	private:
		LPSTR lpCmdLine;
		int nCmdShow;
};

#endif
</code></pre>
<p>So versuche ich das ganze aufzurufen.....</p>
<pre><code class="language-cpp">CMLParser	 *cmlParser;

int WINAPI WinMain(	HINSTANCE	hInstance, 
					HINSTANCE hPrevInstance,
					LPSTR lpCmdLine, 
					int nCmdShow) { 	

	/* save main instance of the application
	 */
	global_hInstance	= hInstance;	

	/* generate cml parser object and verfify whether a valid
	 * commandline is passed...
	 */	
	cmlParser = new CMLParser(lpCmdLine, nCmdShow);	

	if(!cmlParser-&gt;verifyCML()) {		
		return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDlgProc);
	}
</code></pre>
<p>Leider funktioniert das ganze so nicht so recht...<br />
Hat jemand eine Idee was ich falsch mache ?</p>
<p>Danke schonmal,</p>
<p>Gruß Ben.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/181599/probleme-beim-einlesen-der-kommandozeile</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 20:20:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181599.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 May 2007 13:39:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme beim einlesen der Kommandozeile on Tue, 15 May 2007 13:42:24 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich wollte mir eine kleine Klasse schreiben die für mich das Einlesen und das Verarbeiten der Kommandozeilen-Parameter erledigt. Die Klasse sieht so aus:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;CMLParser.hpp&quot;

CMLParser::CMLParser(void) {	

}

CMLParser::CMLParser(LPSTR argv, int argn) {	
	CMLParser::lpCmdLine = argv;
	CMLParser::nCmdShow	= argn;
}

CMLParser::~CMLParser() {

}

bool 
CMLParser::verifyCML() {	
	if((CMLParser::nCmdShow) &gt; 1) {		
		return true;
	}

	return false;
}
</code></pre>
<p>Ihre Header-Datei:</p>
<pre><code class="language-cpp">#ifndef CMLParser_hpp
#define CMLParser_hpp CMLParser_hpp

class CMLParser {
	public:
		//default constructor
		CMLParser();

		//custom constructor
		CMLParser(LPSTR, int);

		//destructor
		~CMLParser();

		//verify that at least one parameter was supplied
		bool verifyCML(void);
	private:
		LPSTR lpCmdLine;
		int nCmdShow;
};

#endif
</code></pre>
<p>So versuche ich das ganze aufzurufen.....</p>
<pre><code class="language-cpp">CMLParser	 *cmlParser;

int WINAPI WinMain(	HINSTANCE	hInstance, 
					HINSTANCE hPrevInstance,
					LPSTR lpCmdLine, 
					int nCmdShow) { 	

	/* save main instance of the application
	 */
	global_hInstance	= hInstance;	

	/* generate cml parser object and verfify whether a valid
	 * commandline is passed...
	 */	
	cmlParser = new CMLParser(lpCmdLine, nCmdShow);	

	if(!cmlParser-&gt;verifyCML()) {		
		return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDlgProc);
	}
</code></pre>
<p>Leider funktioniert das ganze so nicht so recht...<br />
Hat jemand eine Idee was ich falsch mache ?</p>
<p>Danke schonmal,</p>
<p>Gruß Ben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285400</guid><dc:creator><![CDATA[G.Ben]]></dc:creator><pubDate>Tue, 15 May 2007 13:42:24 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme beim einlesen der Kommandozeile on Tue, 15 May 2007 14:53:54 GMT]]></title><description><![CDATA[<blockquote>
<p>Leider funktioniert das ganze so nicht so recht...<br />
Hat jemand eine Idee was ich falsch mache ?</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285457</guid><dc:creator><![CDATA[MKF]]></dc:creator><pubDate>Tue, 15 May 2007 14:53:54 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme beim einlesen der Kommandozeile on Tue, 15 May 2007 15:28:20 GMT]]></title><description><![CDATA[<p>Ich hab mittlerweile mein Problem gefunden. Wenn man nicht weiß was welcher Parameter zu bedeuten hat, dann sollte man es lieber nachlesen, sorry...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285498</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285498</guid><dc:creator><![CDATA[G.Ben]]></dc:creator><pubDate>Tue, 15 May 2007 15:28:20 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme beim einlesen der Kommandozeile on Fri, 18 May 2007 16:03:34 GMT]]></title><description><![CDATA[<p>Warscheinlich schon zu spät, aber guck Dir mal diese Funktionen an, sind vllt hilfreich <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 />
- <a href="http://msdn2.microsoft.com/en-us/library/ms683156.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms683156.aspx</a><br />
- <a href="http://msdn2.microsoft.com/en-us/library/ms647232.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms647232.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287534</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287534</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Fri, 18 May 2007 16:03:34 GMT</pubDate></item></channel></rss>