Execute a B3D.exe from within BMax

BlitzMax Forums/BlitzMax Beginners Area/Execute a B3D.exe from within BMax

Blitzplotter(Posted 2006) [#1]
I have managed to incorporate an app launcher into my types using posts.php topic=53709:-



I can lauch notepad with the above code , however my app that calls notepad doesn't
seem to handover 'control' to the notepad.exe - is the notepad.exe launched as a 'child'
of my primary application ?


My goal is to run a B3D executable which is within the same directory as my primary BMax app.
Do I need to populate the 'path' to the executable, can I use App_Path.... How can I run my B3D.exe which is resident in the same directory as my BMax App from my BMax app ?


Thanks in advance.....


EOF(Posted 2006) [#2]
Try
Local proc:TProcess=TProcess.Create(AppDir+"/MyBlitz3DApp.exe",0)



Blitzplotter(Posted 2006) [#3]
Thanks Jim, that worked, my secondary app executed fine, however to see it I needed to fire in a debugstop to my primary App to stop it from hogging the computers resources...

Any suggestions on how to 'pause' the primary Apps execution until the secondary app has been quit by the user ? Or at least de-prioritise the primary app as far as the operating system is concerned -- maybe a sleep ?

Regards.....


EOF(Posted 2006) [#4]
While proc.Status()
	Delay 100
Wend



TartanTangerine (was Indiepath)(Posted 2006) [#5]
You need to suspend the threads that are part of the primary process. You can then resume the threads when required.


Dreamora(Posted 2006) [#6]
If you want to halt your mainapp use system_(executablepath$) instead of createprocess. That works as execfile on b3d and blocks the main app till the subapp has finished


Blitzplotter(Posted 2006) [#7]
Tried While... Wend - my B3D app did not appear....

Tried System_(execpath$) to no avail also ... could be my syntax... However my debugstop still allows my B3D app to execute when called from my BMax app - not ideal though. Need sleep.....

@ Indiepath - were you thinking along Dreamora's lines ? If not have you a snippet of syntax to illustrate how I suspend my main apps thread - Cheers ...