<?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[Kommandozeilen exe vs. GUI exe]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte ne exe, die beides kann.<br />
Sie soll die Konsole als Ausgabe benutzten, wenn Sie in der Kommandozeile mit ein paar Parametern gestartet wird. Und sie soll mit der GUI starten, wenn sie mit einem dblclick gestartet wird.</p>
<p>Ist so was überhaupt möglich, bzw sinnvoll. Wie würdet ihr das machen? Bzw. ist es ratsam 2 exe anzulegen wie MeinProg_cmd.exe und MeinProg_gui.exe.</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/117472/kommandozeilen-exe-vs-gui-exe</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 16:34:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/117472.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Aug 2005 07:57:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 07:57:14 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte ne exe, die beides kann.<br />
Sie soll die Konsole als Ausgabe benutzten, wenn Sie in der Kommandozeile mit ein paar Parametern gestartet wird. Und sie soll mit der GUI starten, wenn sie mit einem dblclick gestartet wird.</p>
<p>Ist so was überhaupt möglich, bzw sinnvoll. Wie würdet ihr das machen? Bzw. ist es ratsam 2 exe anzulegen wie MeinProg_cmd.exe und MeinProg_gui.exe.</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/847786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847786</guid><dc:creator><![CDATA[elektron_1]]></dc:creator><pubDate>Mon, 08 Aug 2005 07:57:14 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 10:26:33 GMT]]></title><description><![CDATA[<p>kannst einfach ne normale gui appliktion machen und wenn die in die konsole willst, dir mit AllocConsole eine anlegen.<br />
siehe:<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/character_mode_applications.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/character_mode_applications.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/847874</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847874</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Mon, 08 Aug 2005 10:26:33 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 10:47:58 GMT]]></title><description><![CDATA[<p>CMatt schrieb:</p>
<blockquote>
<p>kannst einfach ne normale gui appliktion machen und wenn die in die konsole willst, dir mit AllocConsole eine anlegen.</p>
</blockquote>
<p>Das löst aber mein Problem nicht.<br />
Beim starten der Applikation wird bereits entschieden, ob mit Konsole oder mit GUI gearbeitet wird.<br />
Start App in Kommandozeile (+Parameter) -&gt; Konsole<br />
Start App mit dblclick -&gt; GUI</p>
<p>Meine GUI App soll einfach zusätzlich batchfähig sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/847898</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847898</guid><dc:creator><![CDATA[electron_1]]></dc:creator><pubDate>Mon, 08 Aug 2005 10:47:58 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 12:10:38 GMT]]></title><description><![CDATA[<p>weis zwar nicht genau ob das klappt aber kontrollier doch einfach ob mindestens 2 parameter übergeben werden wenn ja wird console angezeigt wenn nein dann eben die gui(erster parameter ist immer der vollständige pfad)<br />
das müsste eigentlich gehen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/847915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847915</guid><dc:creator><![CDATA[Skippy]]></dc:creator><pubDate>Mon, 08 Aug 2005 12:10:38 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 12:44:09 GMT]]></title><description><![CDATA[<p>Siehe Posting von Olli vom 2005-07-09@18:51: <a href="http://www.delphipraxis.net/post394699.html#394699" rel="nofollow">http://www.delphipraxis.net/post394699.html#394699</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/847938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847938</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Mon, 08 Aug 2005 12:44:09 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 13:22:01 GMT]]></title><description><![CDATA[<p>electron_1 schrieb:</p>
<blockquote>
<p>CMatt schrieb:</p>
<blockquote>
<p>kannst einfach ne normale gui appliktion machen und wenn die in die konsole willst, dir mit AllocConsole eine anlegen.</p>
</blockquote>
<p>Das löst aber mein Problem nicht.<br />
Beim starten der Applikation wird bereits entschieden, ob mit Konsole oder mit GUI gearbeitet wird.<br />
Start App in Kommandozeile (+Parameter) -&gt; Konsole<br />
Start App mit dblclick -&gt; GUI</p>
<p>Meine GUI App soll einfach zusätzlich batchfähig sein.</p>
</blockquote>
<p>versteh nicht wo das problem liegt <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>
<pre><code class="language-cpp">int WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,
            int nCmdShow )
{
 if(IstConsolenParameterDa(lpCmdLine))
 {
   CreateConsole();
 }
 else
 {
  CreateGUIWindow();
 }
 return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/847980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847980</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Mon, 08 Aug 2005 13:22:01 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 13:26:18 GMT]]></title><description><![CDATA[<p>...also geht nicht <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/847988</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847988</guid><dc:creator><![CDATA[electron_1]]></dc:creator><pubDate>Mon, 08 Aug 2005 13:26:18 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 13:32:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/905">@CMatt</a> jetzt warn wir gleichzeitig</p>
<p>muss ich mal ausprobieren, ob deine Lösung auch batchfähig ist. Das Problem, das Olli da beschreibt (thks @ Lucky) ist, dass eine Neue Konsoleninstanz angelegt wird. Möchte man die aktuelle Konsole benutzen, dann geht das nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/847992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/847992</guid><dc:creator><![CDATA[electron_1]]></dc:creator><pubDate>Mon, 08 Aug 2005 13:32:01 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 15:51:09 GMT]]></title><description><![CDATA[<p>hmm... sollte das nicht per AttachConsole machbar sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848142</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Mon, 08 Aug 2005 15:51:09 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Mon, 08 Aug 2005 17:03:51 GMT]]></title><description><![CDATA[<p>was interessant wäre willst du dein programm batchfahig haben oder soll man es auch per hand in der kommandozeile bedienen können?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848194</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848194</guid><dc:creator><![CDATA[Skippy]]></dc:creator><pubDate>Mon, 08 Aug 2005 17:03:51 GMT</pubDate></item><item><title><![CDATA[Reply to Kommandozeilen exe vs. GUI exe on Wed, 10 Aug 2005 11:49:11 GMT]]></title><description><![CDATA[<p>Das Thema hat mich jetzt doch nicht losgelassen - ich hab noch etwas rumprobiert:</p>
<pre><code>#include &quot;stdafx.h&quot;
#include &quot;temp3.h&quot;
#include &quot;mywin.h&quot;

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;
	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
		// TODO: change error code to suit your needs
		cerr &lt;&lt; _T(&quot;Fatal Error: MFC initialization failed&quot;) &lt;&lt; endl;
		nRetCode = 1;
	}
	else
	{
		// TODO: code your application's behavior here.
		if (argc &lt; 2)
		{
		PSTR szCmdLine;
                  //standard WinMain Funktion für ein WinApi Fenster
                  // http://www.winapi.net/index.php?inhalt=tipp1
		WinMain (theApp.m_hInstance, NULL, szCmdLine, SW_SHOW);
		}
		else
		{
		CString strHello;
		strHello.LoadString(IDS_HELLO);
		cout &lt;&lt; (LPCTSTR)strHello &lt;&lt; endl;
		}
	}
	return nRetCode;
}
</code></pre>
<p>Ich habe in ein Win32ConsoleApplication Projekt ein WinApi Fenster eingebaut. Es scheint zu funktionieren.<br />
Mal sehen ob/wie man ein MFC Fenster einbauen kann. Nur leider bin ich ohne MFC Wizard ziemlich aufgeschmissen <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/849330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849330</guid><dc:creator><![CDATA[electron_1]]></dc:creator><pubDate>Wed, 10 Aug 2005 11:49:11 GMT</pubDate></item></channel></rss>