Page 1 of 1

RunProgram error(solved thank you)

Posted: Thu Jun 14, 2007 7:01 pm
by FreeThought

Code: Select all

CalcID = RunProgram("Calc.Exe", "", "", #PB_Program_Open)
Debug CalcID
CloseProgram(CalcID )
I have an error on compiling the above code with debugger on,on 4.10b2, any one having the same problem or just me.(probably my setup).

Posted: Thu Jun 14, 2007 7:05 pm
by codemaniac
Works here?

Image

Posted: Thu Jun 14, 2007 7:18 pm
by FreeThought
@codemaniac
Thanks for testing this . truly appreciate it .please note (threadsafe unchecked).

Posted: Thu Jun 14, 2007 11:14 pm
by codemaniac
When Threadsafe is unchecked it works like in the above image, but when Threadsave is enabled it hangs there with 1000% CPU usage.

Posted: Thu Jun 14, 2007 11:34 pm
by ABBKlaus
confirmed :wink: you should consider moving this to the bugs section :arrow:

Heres a shorter example :

Code: Select all

; Threadsafe must be enabled ! Debugger on
; tested and fails in PB4.02 / PB4.10B2
Debug RunProgram("Calc.Exe")
With disabled debugger and without the debug it works :

Code: Select all

; Threadsafe enabled / Debugger off
; tested in PB4.02 / PB4.10B2
RunProgram("Calc.Exe")
Regards Klaus

Posted: Fri Jun 15, 2007 10:53 am
by PB
> ; Threadsafe must be enabled ! Debugger on
> ; tested and fails in PB4.02 / PB4.10B2
> Debug RunProgram("Calc.Exe")

Works fine here when set to the above conditions and versions.

Posted: Fri Jun 15, 2007 12:47 pm
by FreeThought
well, as I noted above if create threadsafe executable is unchecked,and debugger is on then i get the following msg when compiling:

PureBasic_Compilation0.exe has encountered a problem and needs to close.


(windows xp sp1 4.10b2)

Posted: Sat Jun 16, 2007 4:34 am
by byo
Works here with the mentioned options.

Posted: Sat Jun 16, 2007 5:22 am
by PB
> if create threadsafe executable is unchecked,and debugger is on then
> i get the following msg

Works fine here still. You got any user libraries installed or anything?

Posted: Sat Jun 16, 2007 5:45 am
by ..::Origin::..
Not meaning to change the subject, but for some reason whenever i try to execute a program that doesn't really exist, my program just hangs. (PB4.00) Anyone else get this?

Posted: Sat Jun 16, 2007 8:24 am
by PB
> whenever i try to execute a program that doesn't really exist,
> my program just hangs. (PB4.00) Anyone else get this?

You mean like this?

Code: Select all

Debug RunProgram("c:\NotExists.exe") ; Returns 0 as expected.
If so, no, with v4.02 this code doesn't hang for me. BTW, v4.00 is obsolete
and is therefore not subject to bug investigation anymore (Fred's words).

Posted: Sat Jun 16, 2007 9:47 am
by Baldrick
On my computer PB's 1 line snippet works as expected unless I set the threadsafe option active. When active it just hangs.
However, add a couple of other lines to the code & it works as it should threadsafe active or not.

Code: Select all

If OpenWindow(0,0,0,100,100,"",#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
Debug RunProgram("c:\NotExists.exe") ; Returns 0 as expected.
EndIf
Edit: Tested with PB4.02 & also 4.10B2 with same results

Posted: Sat Jun 16, 2007 9:52 am
by FreeThought
it works now in all cases, what I did is to copy my 4.02 folder to another folder instead of installing new 4.02 to an another . updated it .

many thanks to everyone tried to help.

Posted: Sat Jun 16, 2007 12:30 pm
by ABBKlaus
i think it depends on the processor :!:

My examples works on my laptop (Intel Pentium M 1,70 GHz), but not on my PC (Intel Core2 Duo E6600 2,40 GHz).
With Baldrick addition it works again on both machines :?

PS: and yes it was a clean install of PureBasic V4.02

Regards Klaus