CreateProcess:TStream(Path$)

BlitzMax Forums/BlitzMax Programming/CreateProcess:TStream(Path$)

Fabian.(Posted 2005) [#1]
In BP there is the function CreateProcess(Path$).
Is in BMX anything like that, too?
If not, I'll try to write a module containing it myself.


skn3(Posted 2005) [#2]
I did write some functions to do it, but there was an unexplainable memory exception so I gave up after 110 hours of trying to find why... Good luck :D


FlameDuck(Posted 2005) [#3]
No.


Rimmsy(Posted 2005) [#4]
There's a function to execute a file. Here you go, http://www.blitzwiki.org/index.php/System_Commands

Hope that helps. It's not the same thing but it might help.


Sarge(Posted 2005) [#5]
Yes it is, system_ is CreateProcess.


FlameDuck(Posted 2005) [#6]
No it isn't. System_ waits for the file executed to finish before proceeding with your program. Now if the file you want executed is a server program (like for instance Apache) that "never" finished, your program is going to hang indefinitely.

More importantly tho', if your program is ended (for instance by someone killing it in Taskmanager, or an overzealous windows task scheduler that reckons your program "stopped responding") it's going to take the program you've executed with it.

It is not, by the most broad definition, the same as CreateProcess, which actually launched the program in question in a seperate process. Except on Linux, but that's thanks largely to the OS.


Sarge(Posted 2005) [#7]
Here you go, a simple fix i just made.
Link


Fabian.(Posted 2005) [#8]
'First of all, thanks a lot to all of you!
'It really helps!

'Sorry for late answering but I found some functions which may help:
Extern "Win32"
'Sorry only usable on win32
  Function WinExec ( Cmd:Byte Ptr , Show )
  Function ShellExecuteA ( Wnd , Cmd:Byte Ptr , File:Byte Ptr , Params:Byte Ptr , Dir:Byte Ptr , Show )
  Function CreateProcessA ( App:Byte Ptr , Cmd:Byte Ptr , PrAt , ThAt , InHandels , Flags , Env:Byte Ptr , Dir:Byte Ptr , S , P )
EndExtern
'The last of them is very intressting but not easy not understand ( as I think ).
'ShellExecuteA(...) seems to be equal to ExecFile(Path$) in BB.



Fabian.(Posted 2005) [#9]
I started working on function doing this.
It's not finished, but it'll later so.

CreateProcess.c:
#include <windows.h>

int WinGetStartupInfo ( void * Info )
{
  GetStartupInfo ( Info ) ;
  return 0 ;
}


CreateProcess.bmx:

I've some problems with GetStartupInfo(...) function.
The program stops in debug mode by clicking any button.