<?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]]></title><description><![CDATA[<p>Hallo<br />
ich hab folgendes Problem ich beschäftige mich gerade mit Pipes<br />
und wenn ich die Funktion CreateProcess aufrufe meldet VS Unhandled exception at 0x7c8196f8</p>
<p>Hier mal der Code.</p>
<p>------------------------main.cpp-------------------</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;

#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &quot;terminal.h&quot;
using namespace std;

int main(int argc, char *argv[])
{
    SECURITY_ATTRIBUTES sa;
    sa.nLength=sizeof(sa);
    terminal t;
    t.setPipes();
    t.initizilize(TERMINAL_HIDDEN);

    t.cleanup();

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>--------terminal.h------------------</p>
<pre><code class="language-cpp">#ifndef terminal_h_
#define terminal_h_
#endif
#define TERMINAL_HIDDEN 1
#define TERMINAL_PUBLIC 0
#include &quot;stdafx.h&quot;
#include &lt;windows.h&gt;
#include &lt;iostream&gt;
#include &lt;string.h&gt;
class terminal
{
private:
        std::string error;
        SECURITY_ATTRIBUTES sa;

		SECURITY_DESCRIPTOR sd;
		HANDLE newstdin,newstdout,hwrite,hread;      
public:
       terminal()
	   {

	   };
       int setPipes()
       {
       InitializeSecurityDescriptor(&amp;sd,SECURITY_DESCRIPTOR_REVISION);
       SetSecurityDescriptorDacl(&amp;sd, true, NULL, false);
       sa.lpSecurityDescriptor = &amp;sd;
       sa.nLength=sizeof(sa);
       sa.bInheritHandle=true;
       std::cout&lt;&lt;&quot;hello&quot;&lt;&lt;std::endl;
       if(!CreatePipe(&amp;newstdin,&amp;hwrite,&amp;sa,0))
       {
		   error=&quot;&quot;;
           error=&quot;Could not Create InputPipe&quot;;
           return 0;
		}
        if(!CreatePipe(&amp;newstdout,&amp;hread,&amp;sa,0))
        {
		error=&quot;&quot;;
		error=&quot;Could not Create OutputPipe&quot;;
        return 0;
        }
        return 1;
       };

       int initizilize(int mode);
       void reporterror();

       void cleanup();
       ~terminal()
	   {
	   };

};
</code></pre>
<p>---------------------terminal.cpp-----------------</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;terminal.h&quot;
int terminal::initizilize(int mode)
{

     if(mode==1)
     {
		 STARTUPINFO si;
		 GetStartupInfo(&amp;si);
		 si.dwFlags=STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
		 si.wShowWindow=SW_HIDE;
		 si.hStdError=terminal::newstdout;
		 si.hStdOutput=terminal::newstdout;
		 si.hStdInput=terminal::newstdin;

		//Hier kommt der Fehler
 CreateProcess(L&quot;HALLO&quot;,NULL,NULL,NULL,true,CREATE_NEW_CONSOLE,NULL,NULL,&amp;si,NULL);

        std::cout&lt;&lt;&quot;Terminal runs in HIDDEN MODE&quot;&lt;&lt;std::endl;
     }
	 return 1;
};

void terminal::reporterror()
{
    std::cout&lt;&lt;terminal::error.c_str()&lt;&lt;std::endl;
}
void terminal::cleanup()
{
     CloseHandle(terminal::newstdin);
     CloseHandle(terminal::newstdout);
     CloseHandle(terminal::hread);
     CloseHandle(terminal::hwrite);
};
</code></pre>
<p>Ich hoffe ihr könnt mir helfen</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/181188/createprocess</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 13:58:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181188.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 May 2007 19:45:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateProcess on Thu, 10 May 2007 19:45:15 GMT]]></title><description><![CDATA[<p>Hallo<br />
ich hab folgendes Problem ich beschäftige mich gerade mit Pipes<br />
und wenn ich die Funktion CreateProcess aufrufe meldet VS Unhandled exception at 0x7c8196f8</p>
<p>Hier mal der Code.</p>
<p>------------------------main.cpp-------------------</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;

#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &quot;terminal.h&quot;
using namespace std;

int main(int argc, char *argv[])
{
    SECURITY_ATTRIBUTES sa;
    sa.nLength=sizeof(sa);
    terminal t;
    t.setPipes();
    t.initizilize(TERMINAL_HIDDEN);

    t.cleanup();

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>--------terminal.h------------------</p>
<pre><code class="language-cpp">#ifndef terminal_h_
#define terminal_h_
#endif
#define TERMINAL_HIDDEN 1
#define TERMINAL_PUBLIC 0
#include &quot;stdafx.h&quot;
#include &lt;windows.h&gt;
#include &lt;iostream&gt;
#include &lt;string.h&gt;
class terminal
{
private:
        std::string error;
        SECURITY_ATTRIBUTES sa;

		SECURITY_DESCRIPTOR sd;
		HANDLE newstdin,newstdout,hwrite,hread;      
public:
       terminal()
	   {

	   };
       int setPipes()
       {
       InitializeSecurityDescriptor(&amp;sd,SECURITY_DESCRIPTOR_REVISION);
       SetSecurityDescriptorDacl(&amp;sd, true, NULL, false);
       sa.lpSecurityDescriptor = &amp;sd;
       sa.nLength=sizeof(sa);
       sa.bInheritHandle=true;
       std::cout&lt;&lt;&quot;hello&quot;&lt;&lt;std::endl;
       if(!CreatePipe(&amp;newstdin,&amp;hwrite,&amp;sa,0))
       {
		   error=&quot;&quot;;
           error=&quot;Could not Create InputPipe&quot;;
           return 0;
		}
        if(!CreatePipe(&amp;newstdout,&amp;hread,&amp;sa,0))
        {
		error=&quot;&quot;;
		error=&quot;Could not Create OutputPipe&quot;;
        return 0;
        }
        return 1;
       };

       int initizilize(int mode);
       void reporterror();

       void cleanup();
       ~terminal()
	   {
	   };

};
</code></pre>
<p>---------------------terminal.cpp-----------------</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;terminal.h&quot;
int terminal::initizilize(int mode)
{

     if(mode==1)
     {
		 STARTUPINFO si;
		 GetStartupInfo(&amp;si);
		 si.dwFlags=STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
		 si.wShowWindow=SW_HIDE;
		 si.hStdError=terminal::newstdout;
		 si.hStdOutput=terminal::newstdout;
		 si.hStdInput=terminal::newstdin;

		//Hier kommt der Fehler
 CreateProcess(L&quot;HALLO&quot;,NULL,NULL,NULL,true,CREATE_NEW_CONSOLE,NULL,NULL,&amp;si,NULL);

        std::cout&lt;&lt;&quot;Terminal runs in HIDDEN MODE&quot;&lt;&lt;std::endl;
     }
	 return 1;
};

void terminal::reporterror()
{
    std::cout&lt;&lt;terminal::error.c_str()&lt;&lt;std::endl;
}
void terminal::cleanup()
{
     CloseHandle(terminal::newstdin);
     CloseHandle(terminal::newstdout);
     CloseHandle(terminal::hread);
     CloseHandle(terminal::hwrite);
};
</code></pre>
<p>Ich hoffe ihr könnt mir helfen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282641</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282641</guid><dc:creator><![CDATA[Pacino90]]></dc:creator><pubDate>Thu, 10 May 2007 19:45:15 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess on Thu, 10 May 2007 19:57:51 GMT]]></title><description><![CDATA[<p>letzter Parameter von CreateProcess</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282647</guid><dc:creator><![CDATA[........]]></dc:creator><pubDate>Thu, 10 May 2007 19:57:51 GMT</pubDate></item></channel></rss>