RunProgram error(solved thank you)

Everything else that doesn't fall into one of the other PB categories.
FreeThought
User
User
Posts: 54
Joined: Mon Jul 18, 2005 10:28 am

RunProgram error(solved thank you)

Post 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).
Last edited by FreeThought on Sat Jun 16, 2007 10:02 am, edited 2 times in total.
codemaniac
Enthusiast
Enthusiast
Posts: 289
Joined: Mon Apr 02, 2007 7:22 am
Location: Finland

Post by codemaniac »

Works here?

Image
Cute?
FreeThought
User
User
Posts: 54
Joined: Mon Jul 18, 2005 10:28 am

Post by FreeThought »

@codemaniac
Thanks for testing this . truly appreciate it .please note (threadsafe unchecked).
codemaniac
Enthusiast
Enthusiast
Posts: 289
Joined: Mon Apr 02, 2007 7:22 am
Location: Finland

Post 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.
Cute?
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post 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
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
FreeThought
User
User
Posts: 54
Joined: Mon Jul 18, 2005 10:28 am

Post 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)
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post by byo »

Works here with the mentioned options.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
..::Origin::..
Enthusiast
Enthusiast
Posts: 125
Joined: Sat Jun 17, 2006 3:15 pm

Post 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?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Post 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
FreeThought
User
User
Posts: 54
Joined: Mon Jul 18, 2005 10:28 am

Post 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.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post 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
Post Reply