<?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[CreateProcess ... wieder mal]]></title><description><![CDATA[<p>Hi @ll,<br />
tut mir leid dass ich schon wieder nerve.</p>
<p>Ich versuche -so wie schonmal angedeutet- aus einem Dienst eine *.exe Datei zu starten.</p>
<p>Also die *.exe liegt in &quot;C:\NaDiA\server.exe&quot;.</p>
<pre><code class="language-cpp">if( CreateProcess( _T(&quot;C:\\NaDiA\\server.exe&quot;), &quot;DateiPfad&quot;, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
		WriteToLog( &quot;Server started.&quot; );
</code></pre>
<p>dass ist mein Aufruf für CreateProcess.</p>
<p>Angeblich klappt es immer, aber ich bekomme leider kein Ergebnis.</p>
<p>Ich hatte auch schonmal:</p>
<pre><code class="language-cpp">if( CreateProcess( NULL, _T(&quot;C:\\NaDiA\\server.exe&quot;), NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
		WriteToLog( &quot;Server started.&quot; );
</code></pre>
<p>aber auch dass Funktionierte nicht!</p>
<p>Ich habe schon mal bei der MSDN-Library geschaut, aber da habe ich leider auch nicht alles verstanden.</p>
<p>Kleine Info: ich muss ehrlich gestehen, ich habe nicht verstanden wofür jeder einzelne Parameter sein soll, also vllt. reicht auch schon eine kleine Erklärung dazu.</p>
<p>Ich hoffe ihr könnt mir helfen.</p>
<p>MFG und frohes neues...</p>
<p>PS: ich habe dass Forum schon durchsucht, da wird lediglich CreateProcess empfohlen, aber nie erklärt.</p>
<p>[upd]<br />
Ich bin MSDN nochmal durchgegangen.</p>
<pre><code class="language-cpp">if( CreateProcess( _T(&quot;C:\\NaDiA\\server.exe&quot;), NULL, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, NULL, &amp;programInfo ) )
		WriteToLog( &quot;Server started.&quot; );
</code></pre>
<p>dass kam dabei raus.<br />
Auch dass Funktioniert nicht!</p>
<p>Bitte helft mir... Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/202052/createprocess-wieder-mal</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 22:36:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/202052.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Jan 2008 08:22:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 08:22:28 GMT]]></title><description><![CDATA[<p>Hi @ll,<br />
tut mir leid dass ich schon wieder nerve.</p>
<p>Ich versuche -so wie schonmal angedeutet- aus einem Dienst eine *.exe Datei zu starten.</p>
<p>Also die *.exe liegt in &quot;C:\NaDiA\server.exe&quot;.</p>
<pre><code class="language-cpp">if( CreateProcess( _T(&quot;C:\\NaDiA\\server.exe&quot;), &quot;DateiPfad&quot;, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
		WriteToLog( &quot;Server started.&quot; );
</code></pre>
<p>dass ist mein Aufruf für CreateProcess.</p>
<p>Angeblich klappt es immer, aber ich bekomme leider kein Ergebnis.</p>
<p>Ich hatte auch schonmal:</p>
<pre><code class="language-cpp">if( CreateProcess( NULL, _T(&quot;C:\\NaDiA\\server.exe&quot;), NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
		WriteToLog( &quot;Server started.&quot; );
</code></pre>
<p>aber auch dass Funktionierte nicht!</p>
<p>Ich habe schon mal bei der MSDN-Library geschaut, aber da habe ich leider auch nicht alles verstanden.</p>
<p>Kleine Info: ich muss ehrlich gestehen, ich habe nicht verstanden wofür jeder einzelne Parameter sein soll, also vllt. reicht auch schon eine kleine Erklärung dazu.</p>
<p>Ich hoffe ihr könnt mir helfen.</p>
<p>MFG und frohes neues...</p>
<p>PS: ich habe dass Forum schon durchsucht, da wird lediglich CreateProcess empfohlen, aber nie erklärt.</p>
<p>[upd]<br />
Ich bin MSDN nochmal durchgegangen.</p>
<pre><code class="language-cpp">if( CreateProcess( _T(&quot;C:\\NaDiA\\server.exe&quot;), NULL, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, NULL, &amp;programInfo ) )
		WriteToLog( &quot;Server started.&quot; );
</code></pre>
<p>dass kam dabei raus.<br />
Auch dass Funktioniert nicht!</p>
<p>Bitte helft mir... Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432224</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 08:22:28 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 09:09:30 GMT]]></title><description><![CDATA[<p>Wie initialisierst Du programInfo?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432237</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 07 Jan 2008 09:09:30 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 09:17:10 GMT]]></title><description><![CDATA[<p>Der zweite Parameter *muss* beschreibbar sein! Also keinen Konstanten String übergeben!!!</p>
<p>In der MSDN gibt es doch genügend Beispiele, oder?<br />
<a href="http://msdn2.microsoft.com/en-us/library/ms682512.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms682512.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432240</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 07 Jan 2008 09:17:10 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 09:37:29 GMT]]></title><description><![CDATA[<p><a href="http://www.c-programmieren.com/C-Lernen.html#%C3%96ffnen%20und%20Schlie%C3%9Fen%20einer%20Anwendung%20mit%20CreateProcess%20und%20TerminateProcess" rel="nofollow">Hier</a> dieses Tutorial habe ich benutzt, auch diese Varianten -sogar mit Notepad- funktionieren nicht.</p>
<p>-by the way.. ich habe Vista-</p>
<p>Also, ich habe natürlich bei MSDN nur nach CreateProcess geschaut.. ich wusste nicht dass die wirklich noch so eine Fette beschreibung da haben.</p>
<p>Ich habe da mal drübergeschaut und ich verstehe nicht wieso die da argv[1] verwednen.<br />
Ich benutze in diesem Fall keine Argumente.</p>
<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>Der zweite Parameter *muss* beschreibbar sein!</p>
</blockquote>
<p>Was meinst du damit?</p>
<p>Der wird doch nicht verändert oder?<br />
Was soll ich da deiner meinung nach hinschreiben, wenn ich keine Argumente benutze?</p>
<pre><code class="language-cpp">if( CreateProcess( &quot;C:\\Windows\\System32\\cmd.exe&quot;, &quot;&quot;, NULL, NULL, FALSE, 0, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
		WriteToLog( &quot;Server started.&quot; );
</code></pre>
<p>startUpInfo und programInfo sind genau gleich wie si und pi.<br />
Auch diese Variante funktioniert nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432244</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 09:37:29 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 09:51:42 GMT]]></title><description><![CDATA[<p>sry aber:<br />
Ich habe mal in den Task-Manager geschaut:<br />
es wird nach CreateProcess 5 sek geschlafen, in diesen 5 Sek ist ein neuer Prozes szu sehen &quot;dllhost.exe&quot; der geht auch wieder weg nach 5 sek.</p>
<p>Er erscheint immer dann wenn ich den Dienst starte, oder beende.</p>
<p>[EDIT]</p>
<pre><code class="language-cpp">WriteToLog( &quot;Try to start server:&quot; );

	if( CreateProcess( &quot;C:\\Windows\\System32\\notepad.exe&quot;, &quot;notepad&quot;, NULL, NULL, FALSE, 0, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
	{
		WaitForSingleObject( programInfo.hProcess, INFINITE );
		WriteToLog( &quot;Server started.&quot; );
	}
	else
	{
		WriteToLog( &quot;Cant start server.\n\n&quot; );
		exit(-1);
	}
</code></pre>
<p>er schreibt nicht weiter als &quot;Try to start server:&quot;</p>
<p>Logfile schrieb:</p>
<blockquote>
<p>[Mon Jan 07 10:50:15 2008]: Service Started<br />
[Mon Jan 07 10:50:15 2008]: Try to start server:<br />
[Mon Jan 07 10:50:24 2008]: Service stopped: Service stoped by Controlpanel</p>
</blockquote>
<p>Ich habe halt den Prozess von Hand abgeschaltet, aber auch erst nach 10 Sekunden.<br />
Wieso tut er nichts weiter?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432250</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 09:51:42 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 09:57:04 GMT]]></title><description><![CDATA[<p>Du kannst keine interaktiven Programme aus einem Service starten. Sobald diese auf eine Eingabe warten werden diese terminiert...</p>
<p>Das ehe ich jetzt erst, dass Du mit cmd und Notepad experimentierst!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432253</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 07 Jan 2008 09:57:04 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 10:23:26 GMT]]></title><description><![CDATA[<p>Naja dass ist ja nur Testweise...</p>
<p>Was soll, oder kann ich den Testweise Starten? Gleich mein Serverprogramm?</p>
<p>Das will keine Eingabe, dass wartet auf ne Netzwerkübertragung...</p>
<pre><code class="language-cpp">if( CreateProcess( &quot;C:\\NaDiA\\server.exe&quot;, &quot;server&quot;, NULL, NULL, FALSE, 0, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
	{
		WriteToLog( &quot;Wait for complete start:&quot; );
		ret = WaitForSingleObject( programInfo.hProcess, INFINITE );

		if( WAIT_ABANDONED == ret )
			WriteToLog( &quot;Server start-failure: WAIT_ABANDONED.&quot; );
		else if( WAIT_OBJECT_0 == ret )
			WriteToLog( &quot;Server started.&quot; );
		else if( WAIT_TIMEOUT == ret )
			WriteToLog( &quot;Server start-failure: WAIT_TIMEOUT.&quot; );
		else if( WAIT_FAILED == ret )
			WriteToLog( &quot;Server start-failure: WAIT_FAILED.&quot; );
	}
	else
	{
		WriteToLog( &quot;Cant start server.\n\n&quot; );
		exit(-1);
	}
</code></pre>
<p>[edit]</p>
<pre><code class="language-cpp">WriteToLog( &quot;Try to start server...&quot; );

	if( CreateProcess( _T(&quot;C:\\NaDiA\\server.exe&quot;), _T(&quot;server&quot;), NULL, NULL, FALSE, 0, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
	{
		WriteToLog( &quot;Wait for complete start:&quot; );
		ret = WaitForSingleObject( programInfo.hProcess, 10000 );

		if( WAIT_ABANDONED == ret )
			WriteToLog( &quot;Server start-failure: WAIT_ABANDONED.&quot; );
		else if( WAIT_OBJECT_0 == ret )
			WriteToLog( &quot;Server started.&quot; );
		else if( WAIT_TIMEOUT == ret )
			WriteToLog( &quot;Server start-failure: WAIT_TIMEOUT.&quot; );
		else if( WAIT_FAILED == ret )
			WriteToLog( &quot;Server start-failure: WAIT_FAILED.&quot; );
		else
			WriteToLog( &quot;Server start-failure: Undefined.&quot; );
	}
	else
	{
		WriteToLog( &quot;Cant start server.\n\n&quot; );
		exit(-1);
	}
</code></pre>
<p>==</p>
<blockquote>
<p>[Mon Jan 07 11:21:17 2008]: Service Started<br />
[Mon Jan 07 11:21:17 2008]: Try to start server...<br />
[Mon Jan 07 11:21:17 2008]: Wait for complete start:<br />
[Mon Jan 07 11:21:27 2008]: Server start-failure: WAIT_TIMEOUT.<br />
[Mon Jan 07 11:21:27 2008]: Sleep 5 sec.<br />
[Mon Jan 07 11:21:32 2008]: Try to terminate server:<br />
[Mon Jan 07 11:21:32 2008]: Server terminated.<br />
[Mon Jan 07 11:21:32 2008]: Service works.<br />
[Mon Jan 07 11:21:41 2008]: Service stopped: Service stoped by Controlpanel</p>
</blockquote>
<p>Er wartet 10 Sekunden und dann gehts weiter...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432255</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 10:23:26 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 10:50:58 GMT]]></title><description><![CDATA[<p>Der zweite Parameter muss aber immer noch beschreibbar sein...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432282</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 07 Jan 2008 10:50:58 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 10:56:25 GMT]]></title><description><![CDATA[<p>Und ich frage mich immernoch was du damit meinst... Kannst du mir dass bitte sagen?</p>
<p>Soll dass ein Array sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432290</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 10:56:25 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 11:50:00 GMT]]></title><description><![CDATA[<p>nein, der zweite parameter darf keine konstante sein sondern muss eine variable sein..<br />
so ist es besser:</p>
<pre><code class="language-cpp">CString cmdLine = &quot;C:\\NaDiA\\server.exe server&quot;;
if( CreateProcess( NULL, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )

//usw...
</code></pre>
<p>da du unter vista arbeitest, kann es aber trotzdem probleme mit dem normalen createprocess geben, wegen eingeschränkter user und so.. kann grad nicht nachkucken, aber da gabs irgendeine lösung.. google mal nach &quot;vista createprocess&quot; oder so... hatte glaube auf codeproject mal was gesehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432313</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432313</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Mon, 07 Jan 2008 11:50:00 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:03:47 GMT]]></title><description><![CDATA[<p>Wo ist den CString definiert?<br />
Mein Compiler motzt, weil er dass nicht kennt.</p>
<p>Auf jeden Fall nicht in der String.h</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432322</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:03:47 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:04:19 GMT]]></title><description><![CDATA[<p>Ansonsten einfach mal ein GetLastError(); hinter CreateProcess haengen und schon wirste wissen woran es lag.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432323</guid><dc:creator><![CDATA[dmesg]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:04:19 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:09:14 GMT]]></title><description><![CDATA[<p>schonmal was von der msdn gehört? <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>
<p>MSDN schrieb:</p>
<blockquote>
<p>A CString object consists of a variable-length sequence of characters. CString provides methods and operators using a syntax similar to that of Basic. Concatenation and comparison operators, together with simplified memory management, make CString objects easier to use than ordinary character arrays.</p>
<p>CString does not have a base class.</p>
<p>CString objects also have the following characteristics:</p>
<p>CString objects can grow as a result of concatenation operations.<br />
CString objects follow, value semantics. Think of a CString object as an actual string, not as a pointer to a string.<br />
You can freely substitute CString objects for const char* and LPCTSTR function arguments.<br />
A conversion operator gives direct access to the characters of the string as a read-only array of characters (a C-style string).<br />
Tip Where possible, allocate CString objects on the stack rather than on the heap. This saves memory and simplifies parameter passing.<br />
CString assists you in conserving memory space by allowing two strings sharing the same value also to share the same buffer space. However, if you attempt to change the contents of the buffer directly (not using MFC), you can alter both strings unintentionally. CString provides two methods, CString::LockBuffer and CString::UnlockBuffer, to help you protect your data. When you call LockBuffer, you create a copy of a string, then set the reference count to –1, which locks the buffer. While the buffer is locked, no other string can reference the data in that string, and the locked string will not reference another string. By locking the string in the buffer, you ensure that the exclusive hold of the string on the data remains intact. When you have finished with the data, call UnlockBuffer to reset the reference count to 1.</p>
<p>Remarks</p>
<p>Windows CE does not support the following methods of the CString class:</p>
<p>AnsiToOem<br />
Collate<br />
FormatMessage<br />
OemToAnsi<br />
Requirements</p>
<p>Windows CE versions: 1.0 and later<br />
Header file: Declared in Afx.h</p>
</blockquote>
<p>also afx.h includen, oder auch windows.h</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432329</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432329</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:09:14 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:14:54 GMT]]></title><description><![CDATA[<p>cmd.exe schrieb:</p>
<blockquote>
<p>mySvc.c:9:17: Afx.h: No such file or directory<br />
mySvc.c: In function <code>ServiceMain': mySvc.c:47: error:</code>CString' undeclared (first use in this function)<br />
mySvc.c:47: error: (Each undeclared identifier is reported only once<br />
mySvc.c:47: error: for each function it appears in.)<br />
mySvc.c:47: error: syntax error before &quot;name&quot;<br />
mySvc.c:102: error: `name' undeclared (first use in this function)</p>
</blockquote>
<p>windows.h ist schon längst eingebunden.<br />
Tja und afx.h kennt er nicht...</p>
<p>MSDN habe ich vergessen tut mir leid.</p>
<p>Ich habe in mein LogFile mal GetLastError schreiben lassen.</p>
<p>183 !?</p>
<p>Könnt ihr damit was anfangen?<br />
Wenn nicht:</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>ERROR_ALREADY_EXISTS<br />
183<br />
0xB7<br />
Cannot create a file when that file already exists.</p>
</blockquote>
<p>Ich lege keine Datei an oder!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432333</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432333</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:14:54 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:18:27 GMT]]></title><description><![CDATA[<p>also mein compiler kennt &lt;afx.h&gt; schon...</p>
<p>lies mal dashier, ich hab leider keine zeit:<a href="http://www.mser.net/microsoft-developer-network/29/visual-c++-programming-c++-winapi-296984.shtm" rel="nofollow">http://www.mser.net/microsoft-developer-network/29/visual-c++-programming-c++-winapi-296984.shtm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432336</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:18:27 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:35:05 GMT]]></title><description><![CDATA[<p>Ich nutze den MinGW, der dass wahrscheinlich einfach verpeilt oder so.</p>
<p>Ich habe folgendes gemacht:</p>
<pre><code class="language-cpp">if( CreateProcess( NULL, &quot;\&quot;C:\\NaDiA\\server.exe server\&quot;&quot;, NULL, NULL, FALSE, 0, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
	{
		WriteToLog( &quot;Wait for complete start:&quot; );
		ret = WaitForSingleObject( programInfo.hProcess, 15000 );

		if( WAIT_ABANDONED == ret )
		{
			WriteToLog( &quot;Server start-failure: WAIT_ABANDONED.&quot; );
			error = 1;
		}
		/*else if( WAIT_OBJECT_0 == ret )
		{
			WriteToLog( &quot;Server start-failure: WAIT_OBJECT_0&quot; );
			error = 1;
		}*/
		else if( WAIT_TIMEOUT == ret )
		{
			WriteToLog( &quot;Server start-failure: WAIT_TIMEOUT.&quot; );
			error = 1;
		}
		else if( WAIT_FAILED == ret )
		{
			WriteToLog( &quot;Server start-failure: WAIT_FAILED.&quot; );
			error = 1;
		}
		else
		{

			WriteToLog( intToChar( GetLastError() ) );
			error = 1;
		}
	}
	else
	{
		WriteToLog( &quot;Cant start server.&quot; );
		error = 1;
	}
</code></pre>
<p>Jetzt kommt beim Log:</p>
<p>LogFile schrieb:</p>
<blockquote>
<p>[Mon Jan 07 13:30:30 2008]: Service Started<br />
[Mon Jan 07 13:30:30 2008]: Try to start server...<br />
[Mon Jan 07 13:30:30 2008]: Cant start server.<br />
[Mon Jan 07 13:30:30 2008]: Failure detectet.<br />
[Mon Jan 07 13:30:30 2008]: Service shuting down.</p>
</blockquote>
<p>Dass ist schonmal ein gewisser fortschritt, denn bis jetzt hat er immer behauptet, der Server könne gestartet werden.<br />
Fällt einem da irgendwas komisches auf, wass nicht stimmen könnte?</p>
<p>DANKE FÜR ALL DIE ANTWORTEN... IHR SEID SPITZE...</p>
<p>[edit]Beim Servicestart wird angesagt, dass der Service beendet werden musste... Warum auch immer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432349</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:35:05 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:37:24 GMT]]></title><description><![CDATA[<p>der zweite parameter von createprocess muss eine variable sein, wie oft muss das dann noch gesagt werden? <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 />
Hatte ich in meinem Beispiel auch gezeigt...</p>
<p>mit MinGW kenn ich mich nicht aus, da ich nur schlechte sachen gehört hab davon <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/1432354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432354</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:37:24 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:55:54 GMT]]></title><description><![CDATA[<p>Also:<br />
Ich habe schon längst folgendes versucht:</p>
<pre><code class="language-cpp">char name[50];

	[...]

	memset( name, 0, sizeof(name) );

	strcpy( name, &quot;\&quot;C:\\NaDiA\\server.exe server\&quot;&quot; );

[...]
if( CreateProcess( NULL, name, NULL, NULL, FALSE, 0, NULL, NULL, &amp;startUpInfo, &amp;programInfo ) )
	{
		WriteToLog( &quot;Wait for complete start:&quot; );
</code></pre>
<p>geht auch nicht.</p>
<p>[edit]Bitte beachten: ich programmiere in C</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432362</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:55:54 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 12:57:35 GMT]]></title><description><![CDATA[<p>Rückgabewert? GetLastError()?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432371</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 07 Jan 2008 12:57:35 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 13:13:06 GMT]]></title><description><![CDATA[<p>Rückgabewert von GetLastError = 183,<br />
siehe 6 Posts weiter oben.</p>
<p>Danke schonmal...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432372</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 13:13:06 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 13:21:01 GMT]]></title><description><![CDATA[<p>HeyHo...</p>
<p>Wie es scheint ist das 2te Argument von 'WaitForSingleObject' für die 'Lebensdauer' eines Prozesses zuständig.<br />
Wenn dem so ist, läuft mein Prozess 15 Sekunden.</p>
<p>Denn in diesem Zeitfenster kann ich Nachrichten senden und erhalte den Hinweis dass die Nachricht erfolgreich versendet wurde.</p>
<p>FRAGE:<br />
Kann dieser kreirte Prozess eine MessageBox anzeigen?</p>
<p>Wenn nein raste ich aus... Denn dann habe ich umsonst gearbeitet.</p>
<p>Danke nochmals für alle Beiträge, und alle die noch kommen werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432383</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432383</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 13:21:01 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 13:23:50 GMT]]></title><description><![CDATA[<p>Nochmal: Ein Service kann so einfach keine interaktiven Programm starten, die auf Deinem Desktop sichtbar werden!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432387</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432387</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 07 Jan 2008 13:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 13:26:12 GMT]]></title><description><![CDATA[<p>der prozess, den du startest, kann alles machen, was er will, es ist ja ein eigenständiger prozess...</p>
<p>EDIT: oh, es handelt sich um einen service.. sorry das hatte ich übersehen... dann ist das natürlich nicht so einfach möglich...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432388</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432388</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Mon, 07 Jan 2008 13:26:12 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 13:39:12 GMT]]></title><description><![CDATA[<p>Also...</p>
<p>Service -&gt; startet server.exe -&gt; server.exe hört Port ab -&gt; Nachricht kommt rein -&gt; server.exe öffnet MessageBox und zeigt nachricht an...</p>
<p>Ich habe mir extra 5273652 ewigkeiten angesehen wie ich diesen ***** ... sry... also:</p>
<p>Ich habe mir gedacht wenn ich die *.exe Datei so aufrufe, geht dass. Anscheinend nicht.<br />
Wie bekomme ich dass hin?</p>
<p>NetSend hats doch auch geschaft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432397</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 13:39:12 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 13:55:13 GMT]]></title><description><![CDATA[<p>Nochmal: Ein Service kann kein Programm starten das interaktiv ist!<br />
Soll ich es buchstabieren?</p>
<p>Das ging mal... Seit Vista nicht mehr möglich, also schmink es Dir ab.<br />
Programm die so etwas machen wollen haben eine zweiteilung. Ein Programm was im Desktop des Users läuft und ein Programm im Kontext des (oder als) Service.</p>
<p><a href="http://support.microsoft.com/kb/327618" rel="nofollow">http://support.microsoft.com/kb/327618</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432420</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432420</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 07 Jan 2008 13:55:13 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess ... wieder mal on Mon, 07 Jan 2008 14:30:52 GMT]]></title><description><![CDATA[<p>Omg.</p>
<p>Wieso muss dass so komisch sein.<br />
Also was ich eigentlich nur haben will:<br />
eine MessageBox.</p>
<p>Wie lasse ich 2 *.exe Dateien miteinander komunizieren, und wo soll der Unterschied sein, wenn beide von dem Service gestartet werden.</p>
<p>Dürfen doch eh beide keine Messages anzeigen.</p>
<p>Dass in dem Artikel ist irgendwie komisch. Ich verstehe dass nciht:<br />
Ist da ein Protokoll wass die Komunikation für mcih macht oder soll ich das selber machen?</p>
<p>Gibt es irgendwo dazu ein Tutorial... Ich mache dass erste mal was mit Services und noch dazu was mit *.exe Dateien aufrufen.</p>
<p>Kann mein Service die *.exe Datei so aufrufen dass sie die MessageBoxen anzeigen kann?<br />
Dass war ja ursprünglich dass Ziel.</p>
<p>Danke schonmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432447</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:30:52 GMT</pubDate></item></channel></rss>