<?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[How to start other .exe and return value ?]]></title><description><![CDATA[<p dir="auto">How to start other .exe and return value ?<br />
Is it possible?</p>
]]></description><link>https://forum.qt.io/topic/81518/how-to-start-other-exe-and-return-value</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 10:18:52 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/81518.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Jul 2017 08:43:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to start other .exe and return value ? on Fri, 21 Jul 2017 08:18:56 GMT]]></title><description><![CDATA[<p dir="auto">I think the main question here is: how does your external application returns the data?</p>
<ul>
<li>does it exit with a different code for each possible result (it would be unsual but I'm not ruling it out)?</li>
<li>does it print to standard output (the console) the answer? if so in what format?</li>
<li>does it communicate in any other way (shared memory,DBus,TCP,Local Socket, HTTP, FTP, etc)?</li>
</ul>
]]></description><link>https://forum.qt.io/post/405908</link><guid isPermaLink="true">https://forum.qt.io/post/405908</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Fri, 21 Jul 2017 08:18:56 GMT</pubDate></item><item><title><![CDATA[Reply to How to start other .exe and return value ? on Thu, 20 Jul 2017 10:00:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/taz742">@<bdi>Taz742</bdi></a> said in <a href="/post/405707">How to start other .exe and return value ?</a>:</p>
<blockquote>
<p dir="auto">If my process is run .exe program that has a form we can do emit true or false or QVector ... QList...?<br />
I can not understand how I could do that.</p>
</blockquote>
<p dir="auto">You either use stdout/stdin like shown in my post above. Or you use some kind of IPC (Inter Process Communication). For example shared memory, DBus, ...<br />
See <a href="http://doc.qt.io/qt-5/qtcore-ipc-sharedmemory-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qtcore-ipc-sharedmemory-example.html</a> for shared memory.</p>
]]></description><link>https://forum.qt.io/post/405711</link><guid isPermaLink="true">https://forum.qt.io/post/405711</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 20 Jul 2017 10:00:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to start other .exe and return value ? on Thu, 20 Jul 2017 09:57:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/taz742">@<bdi>Taz742</bdi></a> Please read documentation, everything is there.<br />
See <a href="http://doc.qt.io/qt-5/qiodevice.html#readyRead" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qiodevice.html#readyRead</a>, <a href="http://doc.qt.io/qt-5/qiodevice.html#write-2" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qiodevice.html#write-2</a>, <a href="http://doc.qt.io/qt-5/qprocess.html#readAllStandardOutput" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qprocess.html#readAllStandardOutput</a><br />
There is even an example showing how to do it:</p>
<pre><code>QProcess gzip;
gzip.start("gzip", QStringList() &lt;&lt; "-c");
if (!gzip.waitForStarted())
    return false;

gzip.write("Qt rocks!");
gzip.closeWriteChannel();

if (!gzip.waitForFinished())
    return false;

QByteArray result = gzip.readAll();
</code></pre>
]]></description><link>https://forum.qt.io/post/405710</link><guid isPermaLink="true">https://forum.qt.io/post/405710</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 20 Jul 2017 09:57:57 GMT</pubDate></item><item><title><![CDATA[Reply to How to start other .exe and return value ? on Thu, 20 Jul 2017 09:48:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/j.hilk">@<bdi>J.Hilk</bdi></a><br />
If my process is run .exe program that has a form we can do emit true or false or QVector ... QList...?<br />
I can not understand how I could do that.</p>
]]></description><link>https://forum.qt.io/post/405707</link><guid isPermaLink="true">https://forum.qt.io/post/405707</guid><dc:creator><![CDATA[Taz742]]></dc:creator><pubDate>Thu, 20 Jul 2017 09:48:28 GMT</pubDate></item><item><title><![CDATA[Reply to How to start other .exe and return value ? on Thu, 20 Jul 2017 09:15:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/taz742">@<bdi>Taz742</bdi></a></p>
<p dir="auto">if you want to keep it simple:</p>
<p dir="auto"><a href="http://doc.qt.io/qt-5/qprocess.html#readyReadStandardOutput" target="_blank" rel="noopener noreferrer nofollow ugc">this Signal</a> and <a href="http://doc.qt.io/qt-5/qprocess.html#readAllStandardOutput" target="_blank" rel="noopener noreferrer nofollow ugc">this function</a> most likly.</p>
<p dir="auto">alternatively, QSharedMemory, TCP/UDP ...</p>
]]></description><link>https://forum.qt.io/post/405704</link><guid isPermaLink="true">https://forum.qt.io/post/405704</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Thu, 20 Jul 2017 09:15:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to start other .exe and return value ? on Thu, 20 Jul 2017 09:03:37 GMT]]></title><description><![CDATA[<p dir="auto">Let's assume that we are going to perform the operation that can be accomplished or not. I want to understand that.<br />
For small instance, I send a number to another exe and give it back if this number is less than 100.</p>
]]></description><link>https://forum.qt.io/post/405701</link><guid isPermaLink="true">https://forum.qt.io/post/405701</guid><dc:creator><![CDATA[Taz742]]></dc:creator><pubDate>Thu, 20 Jul 2017 09:03:37 GMT</pubDate></item><item><title><![CDATA[Reply to How to start other .exe and return value ? on Thu, 20 Jul 2017 08:56:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a><br />
Yes I know how to run another program, but how do I get value from it?<br />
Maybe you give me the right direction</p>
]]></description><link>https://forum.qt.io/post/405699</link><guid isPermaLink="true">https://forum.qt.io/post/405699</guid><dc:creator><![CDATA[Taz742]]></dc:creator><pubDate>Thu, 20 Jul 2017 08:56:20 GMT</pubDate></item><item><title><![CDATA[Reply to How to start other .exe and return value ? on Thu, 20 Jul 2017 08:50:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/taz742">@<bdi>Taz742</bdi></a> <a href="http://doc.qt.io/qt-5/qprocess.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qprocess.html</a></p>
]]></description><link>https://forum.qt.io/post/405697</link><guid isPermaLink="true">https://forum.qt.io/post/405697</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 20 Jul 2017 08:50:09 GMT</pubDate></item></channel></rss>