Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

USING createprocess

sreevani
Beginner
689 Views
Hi,
How can I write equivalent for
exec TRIM(filename_exe)
TRIM(temp_data)//'/'//TRIM(Temp_FileName)&
//' '//TRIM(outfilename)

this using createprocess function or is there anyother solution to this other than exec fn
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
689 Views
- Put that as second argument to CreateProcess. Add a //char(0) at the end.
- Take care that, if the path of program's command line argument contains blanks, to enclose it in quotes, e.g. notepad.exe "C:Program FilesWhatever.txt"
- First argument should be NULL
- Make sure to fill in STARTUPINFO structure before the call, at least si%cb = sizeof(si) and si%dwFlags=0.

Jugoslav
0 Kudos
sreevani
Beginner
689 Views
Hi I am having an First.exe whose input is a file, this first.exe calls this second.exe like this
--------------------
! Create new process, wait for process to terminate before returning
wStatus = RUNQQ('second.exe',command_line)

----------------------------------------------
Now this second.exe calls first.exe again for futhur processing then i have written like this
WRITE(unitid,"(A,A,A)")'exec ',first.exe,
' '//inputfile//' '//outputfile

Now when I say like this first time when the first.exe calls the second.exe I am able to work smoothly on other applications but when when second.exe is calling this first.exe i lose the control for example i am working on wordpad then i lose the control that is the cursor does not appear on word pad for me , it is disabled, i have to drag ie click on the word pad again and again for the control to appear. How much time it runs that much time i have to click for every call. How can i get back the control with me only though the process is running in the background.I have tried with the createprocess() but i was not able to get the control , i was able to create the parent process only rather than allow the process to run in the background and help me working smoothly with other work instead of clicking with the mouse to work on the word docs.
0 Kudos
Reply