<?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[Kann mir hier jemand helfen, Probleme mit Pipe???]]></title><description><![CDATA[<p>hallo, hatte es erst in der MFC abteilung versucht, allerdings ohne Erfolg.<br />
'Ich hatte folgendes in der Suche gefunden:</p>
<pre><code class="language-cpp">#define BUFFSIZE 4096 
char cPipeResult[BUFFSIZE]; 
memset(cPipeResult,0,BUFFSIZE); 
DWORD dwBytes =0; 
PROCESS_INFORMATION PROCCINFO; 
LPSECURITY_ATTRIBUTES lpPipeAttributes = NULL; 
HANDLE hReadPipe; 
HANDLE hWritePipe; 
SECURITY_ATTRIBUTES SecAttribs; 
SecAttribs.lpSecurityDescriptor = NULL; 
SecAttribs.bInheritHandle = TRUE; 
SecAttribs.nLength = sizeof(SecAttribs); 
if( ! CreatePipe( &amp;hReadPipe,  &amp;hWritePipe,  &amp;SecAttribs, 0)) 
{ 
    AfxMessageBox(&quot;Konnte Pipe nicht erstellen&quot;); 
} 
else // Ok  Prozess vorbereiten 
{ 
    STARTUPINFO INFO; 
    INFO.cb=sizeof(STARTUPINFO); 
    INFO.lpReserved=NULL; 
    INFO.lpDesktop= NULL; 
    INFO.lpTitle=NULL; 
    INFO.dwX=0; 
    INFO.dwY=0; 
    INFO.dwXSize=100; 
    INFO.dwYSize=100; 
    INFO.dwXCountChars=0; 
    INFO.dwYCountChars=0; 
    INFO.dwFillAttribute=NULL; 
    INFO.dwFlags=STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW|STARTF_USEPOSITION; 
    INFO.wShowWindow= SW_SHOWDEFAULT; 
    INFO.cbReserved2=0; 
    INFO.lpReserved2=NULL; 
    INFO.hStdInput = GetStdHandle(STD_INPUT_HANDLE); 
    INFO.hStdOutput= hWritePipe; 
    INFO.hStdError= GetStdHandle(STD_ERROR_HANDLE); 

    CreateProcess( m_PfadDerExe,NULL, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE| 
                  NORMAL_PRIORITY_CLASS, NULL, NULL, &amp;INFO, &amp;PROCCINFO); 
    WaitForSingleObject(PROCCINFO.hProcess, 5000); 
    ReadFile(hReadPipe, cPipeResult, sizeof(cPipeResult), &amp;dwBytes,NULL); 
    AfxMessageBox(cPipeResult); 
}
</code></pre>
<p>das funktioniert ja wunderbar, allerdings gibt er mir in der Messagebox die kompletten Ausgaben der Konsole an, ich hätte allerdings gerne eine Möglichkeit die einzelnen Ausgaben der Konsole abzufangen und in meinem Programm zu beantworten...</p>
<p>kann mir jemand dabei helfen??? <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/topic/93769/kann-mir-hier-jemand-helfen-probleme-mit-pipe</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 06:44:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/93769.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Dec 2004 12:08:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kann mir hier jemand helfen, Probleme mit Pipe??? on Thu, 02 Dec 2004 12:08:27 GMT]]></title><description><![CDATA[<p>hallo, hatte es erst in der MFC abteilung versucht, allerdings ohne Erfolg.<br />
'Ich hatte folgendes in der Suche gefunden:</p>
<pre><code class="language-cpp">#define BUFFSIZE 4096 
char cPipeResult[BUFFSIZE]; 
memset(cPipeResult,0,BUFFSIZE); 
DWORD dwBytes =0; 
PROCESS_INFORMATION PROCCINFO; 
LPSECURITY_ATTRIBUTES lpPipeAttributes = NULL; 
HANDLE hReadPipe; 
HANDLE hWritePipe; 
SECURITY_ATTRIBUTES SecAttribs; 
SecAttribs.lpSecurityDescriptor = NULL; 
SecAttribs.bInheritHandle = TRUE; 
SecAttribs.nLength = sizeof(SecAttribs); 
if( ! CreatePipe( &amp;hReadPipe,  &amp;hWritePipe,  &amp;SecAttribs, 0)) 
{ 
    AfxMessageBox(&quot;Konnte Pipe nicht erstellen&quot;); 
} 
else // Ok  Prozess vorbereiten 
{ 
    STARTUPINFO INFO; 
    INFO.cb=sizeof(STARTUPINFO); 
    INFO.lpReserved=NULL; 
    INFO.lpDesktop= NULL; 
    INFO.lpTitle=NULL; 
    INFO.dwX=0; 
    INFO.dwY=0; 
    INFO.dwXSize=100; 
    INFO.dwYSize=100; 
    INFO.dwXCountChars=0; 
    INFO.dwYCountChars=0; 
    INFO.dwFillAttribute=NULL; 
    INFO.dwFlags=STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW|STARTF_USEPOSITION; 
    INFO.wShowWindow= SW_SHOWDEFAULT; 
    INFO.cbReserved2=0; 
    INFO.lpReserved2=NULL; 
    INFO.hStdInput = GetStdHandle(STD_INPUT_HANDLE); 
    INFO.hStdOutput= hWritePipe; 
    INFO.hStdError= GetStdHandle(STD_ERROR_HANDLE); 

    CreateProcess( m_PfadDerExe,NULL, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE| 
                  NORMAL_PRIORITY_CLASS, NULL, NULL, &amp;INFO, &amp;PROCCINFO); 
    WaitForSingleObject(PROCCINFO.hProcess, 5000); 
    ReadFile(hReadPipe, cPipeResult, sizeof(cPipeResult), &amp;dwBytes,NULL); 
    AfxMessageBox(cPipeResult); 
}
</code></pre>
<p>das funktioniert ja wunderbar, allerdings gibt er mir in der Messagebox die kompletten Ausgaben der Konsole an, ich hätte allerdings gerne eine Möglichkeit die einzelnen Ausgaben der Konsole abzufangen und in meinem Programm zu beantworten...</p>
<p>kann mir jemand dabei helfen??? <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/664391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664391</guid><dc:creator><![CDATA[Pipe]]></dc:creator><pubDate>Thu, 02 Dec 2004 12:08:27 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir hier jemand helfen, Probleme mit Pipe??? on Thu, 02 Dec 2004 13:47:51 GMT]]></title><description><![CDATA[<p>Einfach nicht auf das Beenden des Prozesses warten - sondern gleich ReadFile. ReadFile blockt solange bis Daten über die Pipe kommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664470</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664470</guid><dc:creator><![CDATA[ScriptGod]]></dc:creator><pubDate>Thu, 02 Dec 2004 13:47:51 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir hier jemand helfen, Probleme mit Pipe??? on Thu, 02 Dec 2004 13:54:10 GMT]]></title><description><![CDATA[<p>kannste mir das bitte genauer erklären, wenn ich wait rausstreiche kommt doch nix mehr an, oder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664481</guid><dc:creator><![CDATA[Pipe-Steht auf Schlauch]]></dc:creator><pubDate>Thu, 02 Dec 2004 13:54:10 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir hier jemand helfen, Probleme mit Pipe??? on Thu, 02 Dec 2004 14:10:32 GMT]]></title><description><![CDATA[<p>ma ne ganz doofe Frage <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>
<p>muss ich denn in die Konsolenanwendung auch was schreiben?<br />
Oder weiss mein Programm selber welche Pipe für die In´s and Out´s sind?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664505</guid><dc:creator><![CDATA[Pipe]]></dc:creator><pubDate>Thu, 02 Dec 2004 14:10:32 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir hier jemand helfen, Probleme mit Pipe??? on Thu, 02 Dec 2004 16:46:58 GMT]]></title><description><![CDATA[<p>Hab es mir nich genau angeschaut, aber evtl. hilft dir <a href="http://msdn.microsoft.com/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp" rel="nofollow">das hier</a> weiter?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664648</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 02 Dec 2004 16:46:58 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir hier jemand helfen, Probleme mit Pipe??? on Fri, 03 Dec 2004 08:22:41 GMT]]></title><description><![CDATA[<p>danke Flenders, das habe ich mir schon ein paar mal angesehen, leider verstehe ich nicht, wie ich es in mein mfc gerüst einbauen soll...<br />
Deswegen hofft ich hier ne Hilfe zu finden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664935</guid><dc:creator><![CDATA[Pipe]]></dc:creator><pubDate>Fri, 03 Dec 2004 08:22:41 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir hier jemand helfen, Probleme mit Pipe??? on Fri, 03 Dec 2004 13:28:16 GMT]]></title><description><![CDATA[<p>Pipe schrieb:</p>
<blockquote>
<p>danke Flenders, das habe ich mir schon ein paar mal angesehen, leider verstehe ich nicht, wie ich es in mein mfc gerüst einbauen soll...<br />
Deswegen hofft ich hier ne Hilfe zu finden</p>
</blockquote>
<p>also wenn du MFC verwendest ist dieser Teil deines Codes falsch</p>
<p>INFO.hStdInput = GetStdHandle(STD_INPUT_HANDLE);<br />
INFO.hStdOutput= hWritePipe;<br />
INFO.hStdError= GetStdHandle(STD_ERROR_HANDLE);</p>
<p>STD_INPUT_HANDLE und STD_ERROR_HANDLE exitieren in deiner MFC Anwendung normalerweise nicht. Auser deine Anwendung wird selber von einer erzeugt, die diese Pipes vererbt (z.B. cmd.exe).<br />
Du brauchst dann bei dir, wenn du mit CreatePipe arbeitest, 2 Pipes.</p>
<p>Wenn du dein Programm debuggst sollte ReadFile blocken, bis Daten gelesen werden oder des Programm sich beenden, was dann zu einem Fehler führt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/665162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/665162</guid><dc:creator><![CDATA[ScriptGod]]></dc:creator><pubDate>Fri, 03 Dec 2004 13:28:16 GMT</pubDate></item></channel></rss>