Yeah, now are working all the methods!!! Thank's you 3 for the help
Codeplug: using the 'call' instead the 'start /wait' have been solving the problem for the use of a bat file. That will be the default bat file for all the php interpret calls
and the CreateProcess (without the inheritance changes) will be a simple
call %php% -f %font% >%out%
So with that I can launch the bat file with some args that will call the php interpret, the bat will wait till the php interpret ends its job, and I'm able to wait till the bat ends its own.
//here the structures setup are the same as on my last 3rd post
//because the problem was on the bat file
CreateProcess("mybatforphp.bat","path_to_php.exe path_to_font.php path_to_tmpoutput.html",NULL,NULL,0,0,NULL,NULL,&si,
//the bat have finished, so here I can access the output
@nthony: sure that the explanations on win32api man.ref. are right, but sometimes people reads between lines to speed up the job (and to obtain more errors and problems, like my case). I have made the corrections you point and now that method also works well:
//sec attributes for the output file
//open the output file on the server's tmp folder (for that test will be on the C:/ root)
//init the STARTUPINFO struct
//setup the redirection
si.hStdError=out;//for the errors, to the same file
//proc sec attributes
//thread sec attributes
//the requested file
sprintf(bff,"-f \"C:\\Documents and Settings\\Aeiou\\SERVIDOR\\dirweb\\demo.php\"");
//create the proc
//wait till the proc ends
anonytmouse: I'll have 'stolen' a trick from your code on the link you posted, the 'CREATE_NO_WINDOW' flag. What's that? Another non-documented win value? It doesn't appears on my copy of Win32PI Man.Ref, but it works.
If you don't mind, I'll use the CreateProcess with the inheritance flags on because in that way only 2 programs will run (the server and the php interpret, in the other case will be running the server, the bat and the php).
So, more thank's to that geat help.