Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

CreateProcess

rswy
Beginner
574 Views
Hi,
I was using 'winexec' to edit data files using notepad in my application.I read recently that winexec is good only for 16 bit and createprocess should be usedfor applications.
However I am not able to use createprocess successfully.For starters I do not know what to use for the startupinfo and process information structure.Can anyone give me an example using createprocess.
Can Shellexecute be used instead or is it also only 16 bit compatible?
--rswy
0 Kudos
1 Reply
james1
Beginner
574 Views
Example code:
program ed
use dfwbase
use kernel32
implicit none
type (T_STARTUPINFO) si
type (T_PROCESS_INFORMATION) pi
call ZeroMemory (LOC(si), SIZEOF(si))
call ZeroMemory (LOC(pi), SIZEOF(pi))
si%cb = SIZEOF (si)
si%dwFlags = STARTF_USESTDHANDLES
if (CreateProcess(NULL,'notepad junk.txt'c,NULL,NULL,FALSE,0,NULL,NULL,si,pi) /= 0) then
  print *, 'Process created', pi%dwProcessId
else
  print *, 'CreateProcess error', GetLastError()
end if
end program ed
James
0 Kudos
Reply