Hi Csaba,<br>I used CreateProcess().This really helps not to block my interpreter.<br><br>The process which I create from the interpreter goes on running while<br>the interpreter finishes. (That is what I want)<br><br>When I create my process, I do not wait for created process to end (functions below<br>
are ignored). So interpreter does not block. <br><br>//WaitForSingleObject( pi.hProcess, INFINITE );<br> //CloseHandle( pi.hProcess );<br><br>Thanks for help,<br>Vijdan <br><br><br><div class="gmail_quote">On Tue, Dec 8, 2009 at 7:03 PM, Csaba Toth <span dir="ltr"><<a href="mailto:ctoth@isis.vanderbilt.edu">ctoth@isis.vanderbilt.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hi Vijdan,</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Again, I advise you to use CreateProcess:</span></p><div class="im">
<p class="MsoNormal"><a href="http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx</a><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
</div><pre><span style="font-size: 11pt; color: rgb(31, 73, 125);">There’s a </span>dwCreationFlags <span style="font-size: 11pt; color: rgb(31, 73, 125);">DWORD parameter for this function, and you can specify the command window behavior with that:</span></pre>
<pre><a href="http://msdn.microsoft.com/en-us/library/ms684863%28VS.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms684863%28VS.85%29.aspx</a></pre><pre> </pre>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Take a look at the </span>DETACHED_PROCESS<span style="font-size: 11pt; color: rgb(31, 73, 125);"> and
the </span>CREATE_NO_WINDOW<span style="font-size: 11pt; color: rgb(31, 73, 125);"> flags, although these refer to console processes, but I think
you can suppress the additional unwanted console window.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Take a look at these,</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Csaba</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:gme-users-bounces@list.isis.vanderbilt.edu" target="_blank">gme-users-bounces@list.isis.vanderbilt.edu</a>
[mailto:<a href="mailto:gme-users-bounces@list.isis.vanderbilt.edu" target="_blank">gme-users-bounces@list.isis.vanderbilt.edu</a>] <b>On Behalf Of </b>Vijdan
KIZILAY<br>
<b>Sent:</b> Tuesday, December 08, 2009 3:18 AM<br>
<b>To:</b> gme-users<br>
<b>Subject:</b> Re: [gme-users] runnning exe from GME dll</span></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom: 12pt;">interpreter is in C++. I solved
my problem.<br>
When I run the exe from the interpreter, a command prompt is also opened with
the exe.<br>
I am closing this command prompt window and then interpreter goes to run the
next code line.<br>
<br>
thanks,<br>
Vijdan<br>
<br>
</p>
<div>
<p class="MsoNormal">On Tue, Dec 8, 2009 at 3:50 AM, Jeff Shanab <<a href="mailto:jshanab@earthlink.net" target="_blank">jshanab@earthlink.net</a>> wrote:</p>
<p class="MsoNormal">Is your interpreter in C++ or Java? I just happened to be
working with a<br>
java interpreter this weekend and needed input from the user.<br>
A simple dialog box was a basic 1 liner in java to get info from the<br>
user. I haven't looked but perhaps the same can be done in c++?</p>
<div>
<div>
<p class="MsoNormal"><br>
Csaba Toth wrote:<br>
><br>
> Hi Vijdan,<br>
><br>
><br>
><br>
> As far as I can understand this is a general programming issue.<br>
><br>
> We say that a call is synchronous (or blocking) if it won’t return
to<br>
> the caller until the task is finished. An asynchronous (or non<br>
> blocking) call returns immediately to the caller point. In that case<br>
> it depends how you’ll be notified about the completion of the
started<br>
> task. Sometimes you can specify some callback or delegate function, or<br>
> you have to set up some kind of IPC (inter process communication) or<br>
> periodically check some resource.<br>
><br>
><br>
><br>
> system is a standard C call and it is blocking (while _/exec//_execve<br>
> is not).<br>
><br>
><br>
><br>
> You need to start a new process or a thread and start your desired<br>
> program from there. Instead of using _exec I suggest to use CreateProcess:<br>
><br>
> <a href="http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx</a><br>
><br>
><br>
><br>
> This is it, if you just want to simply start a program like NotePad.<br>
> If you want to communicate with this process also, that cannot be<br>
> covered in this e-mail.<br>
><br>
><br>
><br>
> Hope that helps,<br>
><br>
> Csaba<br>
><br>
><br>
><br>
><br>
><br>
> *From:* <a href="mailto:gme-users-bounces@list.isis.vanderbilt.edu" target="_blank">gme-users-bounces@list.isis.vanderbilt.edu</a><br>
> [mailto:<a href="mailto:gme-users-bounces@list.isis.vanderbilt.edu" target="_blank">gme-users-bounces@list.isis.vanderbilt.edu</a>]
*On Behalf Of<br>
> *Vijdan KIZILAY<br>
> *Sent:* Monday, December 07, 2009 10:33 AM<br>
> *To:* gme-users<br>
> *Subject:* [gme-users] runnning exe from GME dll<br>
><br>
><br>
><br>
> Hello,<br>
> I have a problem about running exe from a model<br>
> interpreter in GME.<br>
><br>
> I run for example<br>
> (void)system("C:\\WINDOWS\\NOTEPAD.EXE");<br>
> from the model interpreter code.<br>
><br>
> But when I run this exe, my code waits for the cmd to be closed<br>
> for going on.<br>
><br>
> I want my interpreter to goes on? Is there a way?<br>
><br>
> best regards<br>
> Vijdan<br>
></p>
</div>
</div>
<p class="MsoNormal">>
------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> gme-users mailing list<br>
> <a href="mailto:gme-users@list.isis.vanderbilt.edu" target="_blank">gme-users@list.isis.vanderbilt.edu</a><br>
> <a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</a><br>
><br>
<br>
_______________________________________________<br>
gme-users mailing list<br>
<a href="mailto:gme-users@list.isis.vanderbilt.edu" target="_blank">gme-users@list.isis.vanderbilt.edu</a><br>
<a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</a></p>
</div>
<p class="MsoNormal"> </p>
</div></div></div>
</div>
<br>_______________________________________________<br>
gme-users mailing list<br>
<a href="mailto:gme-users@list.isis.vanderbilt.edu">gme-users@list.isis.vanderbilt.edu</a><br>
<a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</a><br>
<br></blockquote></div><br>