<?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[mit createprocess + createpipe Ausgabe einlesen]]></title><description><![CDATA[<p>hi,<br />
mit unten stehenden code möchte ich diverse kommandozeilenprogramme starten un deren ausgabe einlesen und an ein textfeld oder messagebox übergeben.<br />
das klappt soweit auch ganz gut, solange die ausgabe weniger als 2606 zeichen enthält. dann stoppt nämlich die anwendung und in dem textfeld stehen nur die werte bis [2606] + diese zeichen ¼*Æ</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_SHOWNORMAL;
    INFO.cbReserved2=0;
    INFO.lpReserved2=NULL;
    INFO.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
    INFO.hStdOutput= hWritePipe;
    INFO.hStdError= GetStdHandle(STD_ERROR_HANDLE);

    CreateProcess( NULL,(LPTSTR)(LPCTSTR)CstringVariable, NULL, NULL, TRUE,    CREATE_DEFAULT_ERROR_MODE|
                  NORMAL_PRIORITY_CLASS, NULL,&quot;C:\\&quot;, &amp;INFO, &amp;PROCCINFO);
    WaitForSingleObject(PROCCINFO.hProcess, 5000);
    ReadFile(hReadPipe, cPipeResult, sizeof(cPipeResult), &amp;dwBytes,NULL);
	//AfxMessageBox(cPipeResult,MB_OKCANCEL);
    m_sDisplayText1 = cPipeResult;
    UpdateData(FALSE);
    }
}
</code></pre>
<p>Weiss jemand woran es liegen könnte?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/87199/mit-createprocess-createpipe-ausgabe-einlesen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 18:30:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/87199.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Sep 2004 11:17:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to mit createprocess + createpipe Ausgabe einlesen on Mon, 27 Sep 2004 11:17:52 GMT]]></title><description><![CDATA[<p>hi,<br />
mit unten stehenden code möchte ich diverse kommandozeilenprogramme starten un deren ausgabe einlesen und an ein textfeld oder messagebox übergeben.<br />
das klappt soweit auch ganz gut, solange die ausgabe weniger als 2606 zeichen enthält. dann stoppt nämlich die anwendung und in dem textfeld stehen nur die werte bis [2606] + diese zeichen ¼*Æ</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_SHOWNORMAL;
    INFO.cbReserved2=0;
    INFO.lpReserved2=NULL;
    INFO.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
    INFO.hStdOutput= hWritePipe;
    INFO.hStdError= GetStdHandle(STD_ERROR_HANDLE);

    CreateProcess( NULL,(LPTSTR)(LPCTSTR)CstringVariable, NULL, NULL, TRUE,    CREATE_DEFAULT_ERROR_MODE|
                  NORMAL_PRIORITY_CLASS, NULL,&quot;C:\\&quot;, &amp;INFO, &amp;PROCCINFO);
    WaitForSingleObject(PROCCINFO.hProcess, 5000);
    ReadFile(hReadPipe, cPipeResult, sizeof(cPipeResult), &amp;dwBytes,NULL);
	//AfxMessageBox(cPipeResult,MB_OKCANCEL);
    m_sDisplayText1 = cPipeResult;
    UpdateData(FALSE);
    }
}
</code></pre>
<p>Weiss jemand woran es liegen könnte?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/615798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/615798</guid><dc:creator><![CDATA[randell]]></dc:creator><pubDate>Mon, 27 Sep 2004 11:17:52 GMT</pubDate></item></channel></rss>