<?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[fremde exe öffnen schlägt fehl.]]></title><description><![CDATA[<p>Hallo wollte wgnuplot starten um daten zu verarbeiten, aber ich habe schon Probeme die Exe selbs zu öffnen. Unicode ist aktiviert im Project. der code ist folgender:</p>
<pre><code class="language-cpp">//just prototyping
	string pfad = &quot;C:\\\wgnuplot.exe&quot;;  
	int size_int= (int) pfad.length();
	char* pfadpoi=new char[size_int+1];
	memset(pfadpoi,'\0',size_int+1);
	strcpy (pfadpoi, pfad.c_str());

	ShellExecute(0, &quot;open&quot;, pfadpoi, NULL, NULL, SW_SHOWNORMAL);
</code></pre>
<p>der fehler ist folgender:: error C2664: 'ShellExecuteW': Konvertierung des Parameters 2 von 'const char [5]' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.</p>
<p>Mir ist klar das der Parameter selbst vom Typ her nicht stimmt. Aber laut Anleitungen und examples machens doch alle so. Daher bin ich ein wenig verwirrt.</p>
<p>Gruß und danke für hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/270057/fremde-exe-öffnen-schlägt-fehl</link><generator>RSS for Node</generator><lastBuildDate>Sun, 30 Aug 2026 16:52:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/270057.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Jul 2010 21:23:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to fremde exe öffnen schlägt fehl. on Mon, 05 Jul 2010 21:23:08 GMT]]></title><description><![CDATA[<p>Hallo wollte wgnuplot starten um daten zu verarbeiten, aber ich habe schon Probeme die Exe selbs zu öffnen. Unicode ist aktiviert im Project. der code ist folgender:</p>
<pre><code class="language-cpp">//just prototyping
	string pfad = &quot;C:\\\wgnuplot.exe&quot;;  
	int size_int= (int) pfad.length();
	char* pfadpoi=new char[size_int+1];
	memset(pfadpoi,'\0',size_int+1);
	strcpy (pfadpoi, pfad.c_str());

	ShellExecute(0, &quot;open&quot;, pfadpoi, NULL, NULL, SW_SHOWNORMAL);
</code></pre>
<p>der fehler ist folgender:: error C2664: 'ShellExecuteW': Konvertierung des Parameters 2 von 'const char [5]' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.</p>
<p>Mir ist klar das der Parameter selbst vom Typ her nicht stimmt. Aber laut Anleitungen und examples machens doch alle so. Daher bin ich ein wenig verwirrt.</p>
<p>Gruß und danke für hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1921964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1921964</guid><dc:creator><![CDATA[greenghecco]]></dc:creator><pubDate>Mon, 05 Jul 2010 21:23:08 GMT</pubDate></item><item><title><![CDATA[Reply to fremde exe öffnen schlägt fehl. on Tue, 06 Jul 2010 10:09:47 GMT]]></title><description><![CDATA[<ol>
<li>
<p>Der Anwendungsname selbst ist falsch, er enthält drei Backslashes. Zwei sollten reichen.</p>
</li>
<li>
<p>Wenn du für Unicode kompilierst musst du auch Unicode (oder Wide) Strings benutzen, Microsoft hat dafür das Makro _T oder TEXT vorgesehen, IIRC.</p>
</li>
</ol>
<p>Den ganzen Wust kann man also durch</p>
<pre><code class="language-cpp">ShellExecute( 0, _T(&quot;open&quot;), _T(&quot;c:\\wgnuplot.exe&quot;, 0, 0, SW_SHOWNORMAL );
</code></pre>
<p>ersetzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1922132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1922132</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Tue, 06 Jul 2010 10:09:47 GMT</pubDate></item><item><title><![CDATA[Reply to fremde exe öffnen schlägt fehl. on Tue, 06 Jul 2010 14:45:45 GMT]]></title><description><![CDATA[<p>ja erstens ist weil ich den pfad gekürzt habe.<br />
Also er kompiliert öffnet aber das programm noch nicht. Als fehler wird integer 2 zurückgegeben. Also stimmt der Pfad nicht. Ich nutze VS2008 und win7 64bit. Gibt es dort restriktionen bei der pfadangabe. hab zwei flashes weggenommen.. nun ist der Aufruf:</p>
<pre><code class="language-cpp">ShellExecute( 0, _T(&quot;open&quot;), _T(&quot;c:\wgnuplot.exe&quot;), 0, 0, SW_SHOWNORMAL );
</code></pre>
<p>Wenn ich den Pfad direkt im Eplorer eingeben, öffnet die Datei auch!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1922303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1922303</guid><dc:creator><![CDATA[greenghecco]]></dc:creator><pubDate>Tue, 06 Jul 2010 14:45:45 GMT</pubDate></item><item><title><![CDATA[Reply to fremde exe öffnen schlägt fehl. on Tue, 06 Jul 2010 15:12:50 GMT]]></title><description><![CDATA[<p>Jetzt ist da aber wieder ein backslash zuwenig!<br />
Du weisst nicht was Du tust!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1922309</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1922309</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Tue, 06 Jul 2010 15:12:50 GMT</pubDate></item><item><title><![CDATA[Reply to fremde exe öffnen schlägt fehl. on Tue, 06 Jul 2010 16:02:43 GMT]]></title><description><![CDATA[<p>selber fehlercode. ok funzt wenn ich es richtig in C verschiebe. Liegt wohl an den ordnern dazwischen. danke euch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1922325</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1922325</guid><dc:creator><![CDATA[greenghecco]]></dc:creator><pubDate>Tue, 06 Jul 2010 16:02:43 GMT</pubDate></item><item><title><![CDATA[Reply to fremde exe öffnen schlägt fehl. on Tue, 06 Jul 2010 16:04:52 GMT]]></title><description><![CDATA[<p>Hallo greenghecco, schau dir mal das hier an:<br />
<a href="http://pronix.linuxdelta.de/C/standard_C/c_programmierung_4.shtml" rel="nofollow">http://pronix.linuxdelta.de/C/standard_C/c_programmierung_4.shtml</a><br />
Dann müsste einiges klar werden.</p>
<p>EDIT: Was mir noch einfällt: Wenn du anstatt der Backslashes einfach normale Slashes nimmst, funktioniert das auch. Die normalen slashes dürfen allerdings nicht verdoppelt werden.</p>
<p>MfG, Jochen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1922327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1922327</guid><dc:creator><![CDATA[Jochen S.]]></dc:creator><pubDate>Tue, 06 Jul 2010 16:04:52 GMT</pubDate></item><item><title><![CDATA[Reply to fremde exe öffnen schlägt fehl. on Tue, 06 Jul 2010 16:11:14 GMT]]></title><description><![CDATA[<p>schon gut, habe übersehen das be jedem ordner ein doppelslash hinmuss. Geht alles</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1922329</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1922329</guid><dc:creator><![CDATA[greenghecco]]></dc:creator><pubDate>Tue, 06 Jul 2010 16:11:14 GMT</pubDate></item></channel></rss>